Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube Video with \u2019 (single quotation mark) in title breaks download on ext4 filesystem #13027

Closed
nickv2002 opened this issue May 8, 2017 · 2 comments

Comments

@nickv2002
Copy link

@nickv2002 nickv2002 commented May 8, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.05.07. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.05.07

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

$ youtube-dl -v 'https://www.youtube.com/watch?v=53ARF_Ku3GU'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=53ARF_Ku3GU']
[debug] Encodings: locale ANSI_X3.4-1968, fs ANSI_X3.4-1968, out ANSI_X3.4-1968, pref ANSI_X3.4-1968
[debug] youtube-dl version 2017.05.07
[debug] Python version 2.7.9 - Linux-4.4.27-9-osmc-armv7l-with-debian-8.7
[debug] exe versions: ffmpeg 3.2.4-1, ffprobe 3.2.4-1
[debug] Proxy map: {}
[youtube] 53ARF_Ku3GU: Downloading webpage
[youtube] 53ARF_Ku3GU: Downloading video info webpage
[youtube] 53ARF_Ku3GU: Extracting video information
[youtube] 53ARF_Ku3GU: Downloading MPD manifest
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https://r6---sn-n4v7sn7l.googlevideo.com/videoplayback/id/e7701117f2aedc65/itag/137/source/youtube/requiressl/yes/ei/6a4QWbWMGpCg-gO8jLKwBg/mn/sn-n4v7sn7l/initcwndbps/1722500/pl/17/mm/31/ms/au/mv/m/ratebypass/yes/mime/video%2Fmp4/otfp/1/gir/yes/clen/571222763/lmt/1490500478088215/dur/1189.374/key/dg_yt0/upn/QdrHndEOAKM/signature/0AC5F5ED8489747E01E13161504DCACC6EFF648B.7A572021B2ED9391BADAD883275F60D1B8C787B5/mt/1494265463/ip/50.168.54.13/ipbits/0/expire/1494287177/sparams/ip,ipbits,expire,id,itag,source,requiressl,ei,mn,initcwndbps,pl,mm,ms,mv,ratebypass,mime,otfp,gir,clen,lmt,dur/'
[dashsegments] Total fragments: 228
[download] Destination: $5.6K a Month Gardening (Other Peoples Yards)-53ARF_Ku3GU.f137.mp4
[download]   0.9% of ~97.60MiB at  7.75MiB/s ETA 01:14Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 465, in main
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 455, in _real_main
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1896, in download
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 771, in extract_info
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 825, in process_ie_result
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1539, in process_video_result
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1797, in process_info
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1745, in dl
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 360, in download
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/dash.py", line 42, in real_download
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/fragment.py", line 114, in _append_fragment
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 37: ordinal not in range(128)

Description of your issue, suggested solution and other information

The title of this video on YouTube is $5.6K a Month Gardening (Other People’s Yards) so the default title from youtube-dl would be: $5.6K a Month Gardening (Other People’s Yards)-53ARF_Ku3GU.mkv however some filesystems, most notably ext3/4 on Linux, require escaping the ' character in filenames. This seems to be the issue here, because I tried the same youtube-dl 'https://www.youtube.com/watch?v=53ARF_Ku3GU' command on my Mac and youtube-dl worked without any issue. youtube-dl should probably be doing some extra work to escape the characters in the filename here.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 8, 2017

It has nothing to do with escaping. Fix your locale, namely fs encoding should not be ANSI_X3.4-1968. Or use --restrict-filenames.

@dstftw dstftw closed this May 8, 2017
dstftw added a commit that referenced this issue May 8, 2017
… 2 as well (#13027)
@nickv2002
Copy link
Author

@nickv2002 nickv2002 commented Oct 30, 2017

For future ref of anyone who stumbles on to this, in Debian Linux I had to run sudo dpkg-reconfigure locales and then reboot to get my locale set correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.