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

CeskaTelevize Unable to download webpage #7411

Closed
Pitel opened this issue Nov 9, 2015 · 6 comments
Closed

CeskaTelevize Unable to download webpage #7411

Pitel opened this issue Nov 9, 2015 · 6 comments

Comments

@Pitel
Copy link

@Pitel Pitel commented Nov 9, 2015

pi@raspberrypi ~ $ youtube-dl http://www.ceskatelevize.cz/porady/10570561091-stardance-vii/214522160450001-stardance-vii-kdyz-hvezdy-tanci/video/429512
[debug] System config: []
[debug] User config: [u'-v']
[debug] Command-line args: [u'http://www.ceskatelevize.cz/porady/10570561091-stardance-vii/214522160450001-stardance-vii-kdyz-hvezdy-tanci/video/429512']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.11.02
[debug] Python version 2.7.3 - Linux-4.1.12+-armv6l-with-debian-7.8
[debug] exe versions: avconv 9.14-6, avprobe 9.14-6
[debug] Proxy map: {}
[CeskaTelevize] 214522160450001-stardance-vii-kdyz-hvezdy-tanci429512: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.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 complete output.
  File "/home/pi/bin/youtube-dl/youtube_dl/extractor/common.py", line 329, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/pi/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1873, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 445, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
@mcepl
Copy link
Contributor

@mcepl mcepl commented Dec 2, 2016

I guess, the same thing:

matej@mitmanek: ~$ youtube-dl -v 'http://www.ceskatelevize.cz/porady/10150778447-historie-cs/216452801400033-co-cech-to-muzikant'
[debug] System config: ['--prefer-free-formats']
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.ceskatelevize.cz/porady/10150778447-historie-cs/216452801400033-co-cech-to-muzikant']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.11.22
[debug] Python version 3.5.2 - Linux-4.8.10-300.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five
[debug] exe versions: ffmpeg 3.1.5, ffprobe 3.1.5
[debug] Proxy map: {}
[CeskaTelevize] 216452801400033-co-cech-to-muzikant: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 404, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 2000, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib64/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib64/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

matej@mitmanek: ~$ 

And no, @dstftw, I don't think this has anything to do with geographical location. I am sitting in Prague and have only the Czech Internet connection on.

@mcepl
Copy link
Contributor

@mcepl mcepl commented Dec 2, 2016

@sleep-walker, any thoughts on this? Can you reproduce?

@sleep-walker
Copy link
Contributor

@sleep-walker sleep-walker commented Dec 2, 2016

Yes, I can reproduce it.
First problem is the replacement on line 94 transforming /porady/... to /ivysilani/... which doesn't seem to work well in this case.
But it is not working yet after that either.

@sleep-walker
Copy link
Contributor

@sleep-walker sleep-walker commented Dec 3, 2016

It's wild guess without actual test but it could look like this instead:

        porady = re.match(r'(https?://www.ceskatelevize.cz)/porady/([^/]+)/.*', url)
        if porady:
            url = porady.group(1) + '/ivysilani/' + porady.group(2)
        url = url.replace('/video/', '')

It would be nice to increase test coverage.

@sleep-walker
Copy link
Contributor

@sleep-walker sleep-walker commented Dec 8, 2016

Have you found URLs which won't work with this change? If there is none, I'll prepare patch and merge request...

@rindeal rindeal mentioned this issue Apr 4, 2017
3 of 8 tasks complete
@dstftw dstftw closed this in 28b674c Apr 8, 2017
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.

4 participants
You can’t perform that action at this time.