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

Error downloading PBS video #7674

Closed
mgilbir opened this issue Nov 27, 2015 · 1 comment
Closed

Error downloading PBS video #7674

mgilbir opened this issue Nov 27, 2015 · 1 comment

Comments

@mgilbir
Copy link

@mgilbir mgilbir commented Nov 27, 2015

When trying to download on OSX El Capitan (10.11.1) a PBS video I get a python exception.

$ youtube-dl -v http://www.pbs.org/wgbh/frontline/film/real-csi/
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.pbs.org/wgbh/frontline/film/real-csi/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.11.24
[debug] Python version 2.7.10 - Darwin-15.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.8.2, ffprobe 2.8.2
[debug] Proxy map: {}
[PBS] real-csi: Downloading webpage
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/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 410, in main
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 400, in _real_main
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1669, in download
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 663, in extract_info
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 290, in extract
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/pbs.py", line 257, in _real_extract
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/pbs.py", line 239, in _extract_webpage
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 141, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or buffer
@bonacker
Copy link

@bonacker bonacker commented Nov 28, 2015

There are a lot of PBS videos that don't have the basic PBS domain http://video.pbs.org . Many PBS affiliates (WGBH, for example) have videos for streaming with their own domains or URLs.

The trick is to get the number of the video at the end of the URL that youtube-dl doesn't recognize such as http://watch.knpb.org/video/2365616055/ .

Then insert that number in the main PBS URL that youtube-dl does recognize. Template: http://video.pbs.org/video/ [PBS video #]

It sometimes takes a little poking around to get the "magic" number. In your case, the number is revealed in the source code for your page.
http://www.pbs.org/wgbh/frontline/film/real-csi/ . (You get the source code with CTRL+U in Chrome or Firefox)

Your magic number is 2223977258.

http://video.pbs.org/video/2223977258 works in yourube-dl for
http://www.pbs.org/wgbh/frontline/film/real-csi/

@dstftw dstftw closed this in d0c8b27 Dec 8, 2015
dstftw added a commit that referenced this issue Dec 8, 2015
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
3 participants
@mgilbir @bonacker and others
You can’t perform that action at this time.