ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.32k stars 9.95k forks source link

Support BBC downloads? #2184

Closed KeithCu closed 9 years ago

KeithCu commented 10 years ago

I tried to use youtube-dl to download from the BBC site and it didn't work. Can you fix? youtube-dl --verbose http://www.bbc.co.uk/programmes/p01q7wz1 [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['--verbose', 'http://www.bbc.co.uk/programmes/p01q7wz1'] [debug] Encodings: locale 'UTF-8', fs 'utf-8', out 'UTF-8', pref: 'UTF-8' [debug] youtube-dl version 2014.01.17.2 [debug] Python version 3.3.3 - Linux-3.12.7-2-ARCH-x86_64-with-arch-Arch-Linux [debug] Proxy map: {} [generic] p01q7wz1: Requesting header WARNING: Falling back on generic information extractor. [generic] p01q7wz1: Downloading webpage [generic] p01q7wz1: Extracting information ERROR: Unsupported URL: http://www.bbc.co.uk/programmes/p01q7wz1; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update. Traceback (most recent call last): File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 493, in extract_info ie_result = ie.extract(url) File "/usr/lib/python3.3/site-packages/youtube_dl/extractor/common.py", line 155, in extract return self._real_extract(url) File "/usr/lib/python3.3/site-packages/youtube_dl/extractor/generic.py", line 346, in _real_extract raise ExtractorError('Unsupported URL: %s' % url) youtube_dl.utils.ExtractorError: Unsupported URL: http://www.bbc.co.uk/programmes/p01q7wz1; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.

Strolls commented 10 years ago

I doubt it's worth youtube-dl supporting iPlayer, when get_iplayer's support is so good.

Most programmes on iPlayer are restricted to the UK, so this work would not be beneficial to the majority of youtube-dl's users.

I very much recommend get_iplayer instead.

KeithCu commented 10 years ago

I think it is worth it. youtube-dl works with lots of sites. I tried get_iplayer. For starters, it is very complicated. Second, it doesn't work: get_iplayer http://www.bbc.co.uk/programmes/p01q7wz1 get_iplayer v2.85, Copyright (C) 2008-2010 Phil Lewis INFO: Trying pid: http://www.bbc.co.uk/programmes/p01q7wz1 using type: tv INFO Trying to stream pid using type tv INFO: pid not found in tv cache

WARNING: No programmes are available for this pid with version(s): default

I tried a few other "type" settings and it didn't work. It also didn't show up in the index it downloaded. The help is complicated and not useful. It looks powerful, but I don't want any of that. I might keep at it, but I think it would be nice if youtube-dl would just work for the BBC like it does for soundcloud.

Strolls commented 10 years ago

This isn't a technical support forum, especially not for unrelated programmes.

If you post your get_iplayer question somewhere more appropriate (such as that program's mailing list) and send me a link by private message, I'll be glad to address it there.

If you think iPlayer support would be useful for youtube-dl, feel free to submit a patch. Maybe rg3 will be interested in supporting it himself, I can't speak for him. I've said what I think, though.

KeithCu commented 10 years ago

I didn't ask for technical support. What I was trying to explain is why get_iplayer is not a good substitute for me. Asking me to submit a patch is impolite: http://programmers.stackexchange.com/a/68751

Strolls commented 10 years ago

Cluttering bug reports with irrelevancies - such as error messages from unrelated programs and complaints about politeness - is even more rude.

One might say that doing so is ignorant - it tends to suggest you don't know what a bug tracker is for. Maybe you could look that up.

This page is only for discussion of technical issues relating to implementation of BBC iPlayer support in youtube-dl. Please can you refrain from discussing anything else here.

I'm sorry if I've offended you - if so, please complain to github.com, please discuss it with me personally by private message or email, but not on this page. This page is a bug report, not a discussion forum.

I only originally replied to give technical reasons why I think implementing this request is a bad idea: the technical burden would be high, and not worth the benefits.

jaimeMF commented 10 years ago

Please calm down. There's no problem if some content is only available in the UK, we already have support for sites with content restricted to some countries, like toutv, rtlnow or vevo.com. We obviously would appreciate contributions, if someone wants to add support and have the skills and time to do it, then go ahead.

phihag commented 10 years ago

@KeithCu Thank you very much for your report. Support for BBC radio has been added in youtube-dl 2014.02.08. It looks like you've installed youtube-dl via pip or your distribution's package manager (as opposed to the manual installation.

If you used pip, run sudo pip -U youtube-dl.

If you used your distribution's package manager to install youtube-dl, use your package manager to update. You may need to contact your distribution's youtube-dl maintainer for a new version.

dstftw commented 10 years ago

Working on TV episodes extraction.

dstftw commented 10 years ago

All TV/Radio media from BBC iPlayer should be downloadable in next release, testers from the UK are very welcome to try grabbing some TV episodes.

Further potential improvements:

KeithCu commented 10 years ago

I just grabbed the latest version of youtube-dl from the Arch repos and was able to fetch the podcast. Thank you! I checked out the diff and it wasn't too bad. I hope you liked the music ;-)

pihug12 commented 10 years ago

Hey! I just got an HTTP Error 403 trying to download a BBC iPlayer video from France.

python youtube-dl http://www.bbc.co.uk/iplayer/episode/b03xgzb8/Winter_Olympics_Sochi_2014_Highlights_Day_11_Snowboarding_Mens_Cross/ --verbose
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['http://www.bbc.co.uk/iplayer/episode/b03xgzb8/Winter_Olympics_Sochi_2014_Highlights_Day_11_Snowboarding_Mens_Cross/', '--verbose']
[debug] Encodings: locale 'cp1252', fs 'mbcs', out 'utf-8', pref: 'cp1252'
[debug] youtube-dl version 2014.02.19.1
[debug] Python version 2.7.6 - Windows-7-6.1.7601-SP1
[debug] Proxy map: {}
[bbc.co.uk] b03xgzb8: Downloading playlist XML
[bbc.co.uk] b03xgz9j: Downloading media selection XML
ERROR: Unable to download XML: HTTP Error 403: Forbidden; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
  File "youtube-dl\youtube_dl\extractor\common.py", line 191, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "youtube-dl\youtube_dl\YoutubeDL.py", line 1157, in urlopen
    return self._opener.open(req)
  File "D:\Python27\lib\urllib2.py", line 410, in open
    response = meth(req, response)
  File "D:\Python27\lib\urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "D:\Python27\lib\urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "D:\Python27\lib\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "D:\Python27\lib\urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
dstftw commented 10 years ago

BBC iPlayer TV is not available outside the UK.

Currently BBC iPlayer TV programmes are available to play in the UK only, but all BBC iPlayer Radio programmes are available to you.

phihag commented 10 years ago

@dstftw Can we detect that during extraction and generate a better error message?

dstftw commented 10 years ago

@phihag, there is an error explanation in response body of an API call, but because of 403 it's not extracted. We might probably want some mechanism to control whether we still want to extract response body despite of HTTP error. For now, we can just fetch requested URL before main processing and search for "Currently BBC iPlayer TV programmes are available to play in the UK only" string.

kaihendry commented 10 years ago

Can't seem to download World Cup highlights.

[hendry@bible ~]$ youtube-dl --verbose http://www.bbc.co.uk/sport/0/football/28221528
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.bbc.co.uk/sport/0/football/28221528']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.06.26
[debug] Python version 3.4.1 - Linux-3.15.1-1-ARCH-x86_64-with-arch
[debug] Proxy map: {}
[generic] 28221528: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 28221528: Downloading webpage
[generic] 28221528: Extracting information
ERROR: Unsupported URL: http://www.bbc.co.uk/sport/0/football/28221528; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/youtube_dl/YoutubeDL.py", line 516, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/common.py", line 167, in extract
    return self._real_extract(url)
  File "/usr/lib/python3.4/site-packages/youtube_dl/extractor/generic.py", line 741, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
youtube_dl.utils.ExtractorError: Unsupported URL: http://www.bbc.co.uk/sport/0/football/28221528; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Mygod commented 8 years ago

Can't download videos in events.

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--proxy', u'127.0.0.1:8887', u'-f',
u'bestvideo+bestaudio', u'--write-sub', u'--external-downloader', u'aria2-1.20.0
-win-64bit-build1\\aria2c', u'--external-downloader-args', u'-s16 -k1M -x16', u'
--ffmpeg-location', u'G:\\Software\\ffmpeg\\bin\\ffmpeg.exe', u'http://www.bbc.c
o.uk/events/ebgv2m#b07jl8n5']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2016.02.13
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-68289-g208c03a, ffprobe N-68289-g208c03a
[debug] Proxy map: {u'http': u'127.0.0.1:8887', u'https': u'127.0.0.1:8887'}
[bbc] ebgv2m: Downloading webpage
ERROR: Unable to extract playlist data; please report this issue on https://yt-d
l.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to
update. Be sure to call youtube-dl with the --verbose flag and include its compl
ete output.
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.pyo", line 666, in extract_info
  File "youtube_dl\extractor\common.pyo", line 315, in extract
  File "youtube_dl\extractor\bbc.pyo", line 876, in _real_extract
  File "youtube_dl\extractor\common.pyo", line 610, in _search_regex
RegexNotFoundError: Unable to extract playlist data; please report this issue on
 https://yt-dl.org/bug . Make sure you are using the latest version; type  youtu
be-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and incl
ude its complete output.