Strip leading dots from file names when charset conversion removes leading characters #4634

Open
opened 2026-02-21 02:16:32 -05:00 by deekerman · 0 comments
Owner

Originally created by @canavan on GitHub (May 14, 2015).

This is a followup to Strip leading dots from file names #2865. If locale conversion, e.g. from UTF-8 to C, or, in my case en_US removes leading chraracters from the filename, the resulting filename may still start with a "."

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'-f', u'18/5/17', u'-l', u'https://www.youtube.com/embed/N4Yrgkt2JPI']
[debug] Encodings: locale ISO8859-1, fs ISO8859-1, out ISO8859-1, pref ISO8859-1
[debug] youtube-dl version 2015.05.10
[debug] Python version 2.7.6 - IRIX64-6.5-IP35-mips-n32bit-ELF
[debug] exe versions: ffmpeg UNKNOWN, ffprobe UNKNOWN, rtmpdump 2.2b
[debug] Proxy map: {}
[youtube] N4Yrgkt2JPI: Downloading webpage
[youtube] N4Yrgkt2JPI: Extracting video information
[youtube] N4Yrgkt2JPI: Downloading DASH manifest
[debug] Invoking downloader on u'https://r6---sn-oxujvavbox-jbol.googlevideo.com/videoplayback?key=yt5&itag=18&upn=uIaMLcklqdE&signature=40B5373B6581675E5AA07F5EEB0CA2AE869D0E63.C3E7A8C7ABE8B6071A8FF5B31ED51D3D3F1259B5&ratebypass=yes&source=youtube&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&sver=3&fexp=909721%2C9407122%2C9407891%2C9408142%2C9408588%2C9408706%2C9408710%2C9408788%2C9409273%2C9412481%2C945137%2C948124%2C952612%2C952637%2C952642&expire=1431635260&initcwndbps=1286250&dur=189.567&mv=m&mt=1431613531&ms=au&requiressl=yes&ip=87.78.24.240&ipbits=0&mm=31&pl=22&id=o-AGsqKdOy9Y55U2-eDHx77fqLbSfKXWr7qjU3LmLRNNnQ&mime=video%2Fmp4'
[download] Destination: ... - Compassion is true communication (Official HD)-N4Yrgkt2JPI.mp4
[download] 100% of 8.11MiB in 00:11

Originally created by @canavan on GitHub (May 14, 2015). This is a followup to Strip leading dots from file names #2865. If locale conversion, e.g. from UTF-8 to C, or, in my case en_US removes leading chraracters from the filename, the resulting filename may still start with a "." [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'--verbose', u'-f', u'18/5/17', u'-l', u'https://www.youtube.com/embed/N4Yrgkt2JPI'] [debug] Encodings: locale ISO8859-1, fs ISO8859-1, out ISO8859-1, pref ISO8859-1 [debug] youtube-dl version 2015.05.10 [debug] Python version 2.7.6 - IRIX64-6.5-IP35-mips-n32bit-ELF [debug] exe versions: ffmpeg UNKNOWN, ffprobe UNKNOWN, rtmpdump 2.2b [debug] Proxy map: {} [youtube] N4Yrgkt2JPI: Downloading webpage [youtube] N4Yrgkt2JPI: Extracting video information [youtube] N4Yrgkt2JPI: Downloading DASH manifest [debug] Invoking downloader on u'https://r6---sn-oxujvavbox-jbol.googlevideo.com/videoplayback?key=yt5&itag=18&upn=uIaMLcklqdE&signature=40B5373B6581675E5AA07F5EEB0CA2AE869D0E63.C3E7A8C7ABE8B6071A8FF5B31ED51D3D3F1259B5&ratebypass=yes&source=youtube&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&sver=3&fexp=909721%2C9407122%2C9407891%2C9408142%2C9408588%2C9408706%2C9408710%2C9408788%2C9409273%2C9412481%2C945137%2C948124%2C952612%2C952637%2C952642&expire=1431635260&initcwndbps=1286250&dur=189.567&mv=m&mt=1431613531&ms=au&requiressl=yes&ip=87.78.24.240&ipbits=0&mm=31&pl=22&id=o-AGsqKdOy9Y55U2-eDHx77fqLbSfKXWr7qjU3LmLRNNnQ&mime=video%2Fmp4' [download] Destination: ... - Compassion is true communication (Official HD)-N4Yrgkt2JPI.mp4 [download] 100% of 8.11MiB in 00:11
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#4634
No description provided.