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: Unable to extract video url [Pornhub.com] #12470

Closed
surcouf9 opened this issue Mar 17, 2017 · 13 comments
Closed

ERROR: Unable to extract video url [Pornhub.com] #12470

surcouf9 opened this issue Mar 17, 2017 · 13 comments
Labels

Comments

@surcouf9
Copy link

@surcouf9 surcouf9 commented Mar 17, 2017


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

ISSUE: youtube-dl won't download videos or playlists from pornhub.com.

<begin log>
...
$ youtube-dl -v http://www.pornhub.com/view_video.php?viewkey=1874321084
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'http://www.pornhub.com/view_video.php?viewkey=1874321084']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.03.16
[debug] Python version 2.7.12 - Linux-4.4.0-53-generic-x86_64-with-LinuxMint-18.1-serena
[debug] exe versions: none
[debug] Proxy map: {}
[PornHub] 1874321084: Downloading webpage
[PornHub] 1874321084: Downloading webpage
ERROR: Unable to extract video url; 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.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 761, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 427, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/pornhub.py", line 134, in _real_extract
    'video url', group='url')
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 759, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract video url
...
<end of log>
@Modryz
Copy link

@Modryz Modryz commented Mar 17, 2017

+1

1 similar comment
@Omega9
Copy link

@Omega9 Omega9 commented Mar 18, 2017

+1

@yan12125 yan12125 added the broken-IE label Mar 18, 2017
@szunyi
Copy link

@szunyi szunyi commented Mar 20, 2017

+1

@throaway123123
Copy link

@throaway123123 throaway123123 commented Mar 20, 2017

Old regexp is: r'<video[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//.+?)\1',

New HTML, e.g., is:

        <div class="videoContainer" data-segment="1">
                <video id="html5Player" class="playerhtml5 wide"  poster="" width="100%" preload="metadata" autoplay></video>
...
<script type="text/javascript">
        var rae149003ra58rae149003ra58="&e=149003";var ra1522mp4ra35ra1522mp4ra35="1522.mp" + "4?";var raphncdncra55raphncdncra55=".phncdn.c";var ra4562hc3ra86ra4562hc3ra86="4562&h=c3";var ra490027362ra35ra490027362ra35="490027362";var rahttpbvra40rahttpbvra40="http://bv";var ra1400s1ra87ra1400s1ra87="=1400&s" + "=1";var ra18bra20ra18bra20="18b";var ra8a4fee2fbra67ra8a4fee2fbra67="8a4fee2" + "fb";var rars107rira98rars107rira98="rs=107&ri";var raipa5015ra69raipa5015ra69="ipa=50." + "15";var ra72378152ra69ra72378152ra69="7/23781" + "52";var ra2vl480ra36ra2vl480ra36="2/vl_480_";var ra47b3fa3d5ra19ra47b3fa3d5ra19="47b3fa3" + "d5";var raomvideosra31raomvideosra31="om/videos";var rabc2bd5e20ra31rabc2bd5e20ra31="bc2bd" + "5e20";var ra682k2378ra93ra682k2378ra93="682k_2378";var ra911647ra49ra911647ra49="9.116.47&";var ra2014022ra49ra2014022ra49="/201402/2";var mediastring=/* + ra1400s1ra87ra1400s1ra87 + */rahttpbvra40rahttpbvra40 + /* + ra4562hc3ra86ra4562hc3ra86 + */raphncdncra55raphncdncra55 + /* + rabc2bd5e20ra31rabc2bd5e20ra31 + */raomvideosra31raomvideosra31 + /* + rae149003ra58rae149003ra58 + */ra2014022ra49ra2014022ra49 + /* + ra47b3fa3d5ra19ra47b3fa3d5ra19 + */ra72378152ra69ra72378152ra69 + /* + ra2014022ra49ra2014022ra49 + */ra2vl480ra36ra2vl480ra36 + /* + rabc2bd5e20ra31rabc2bd5e20ra31 + */ra682k2378ra93ra682k2378ra93 + /* + ra1522mp4ra35ra1522mp4ra35 + */ra1522mp4ra35ra1522mp4ra35 + /* + rae149003ra58rae149003ra58 + */raipa5015ra69raipa5015ra69 + /* + raipa5015ra69raipa5015ra69 + */ra911647ra49ra911647ra49 + /* + ra18bra20ra18bra20 + */rars107rira98rars107rira98 + /* + ra2vl480ra36ra2vl480ra36 + */ra1400s1ra87ra1400s1ra87 + /* + ra8a4fee2fbra67ra8a4fee2fbra67 + */ra490027362ra35ra490027362ra35 + /* + ra682k2378ra93ra682k2378ra93 + */rae149003ra58rae149003ra58 + /* + ra911647ra49ra911647ra49 + */ra4562hc3ra86ra4562hc3ra86 + /* + raomvideosra31raomvideosra31 + */ra47b3fa3d5ra19ra47b3fa3d5ra19 + /* + ra47b3fa3d5ra19ra47b3fa3d5ra19 + */ra8a4fee2fbra67ra8a4fee2fbra67 + /* + ra72378152ra69ra72378152ra69 + */rabc2bd5e20ra31rabc2bd5e20ra31 + /* + ra1522mp4ra35ra1522mp4ra35 + */ra18bra20ra18bra20;</script>

The URL can be decoded pretty easily ("mediastring" var) but requires parsing javascript. The video URL doesn't require any cookies or particular user agent (tested with wget).

@snpwr
Copy link

@snpwr snpwr commented Mar 21, 2017

I created a fix too. Seems you were faster @throawayagain123.

@throawayagain123
Copy link

@throawayagain123 throawayagain123 commented Mar 21, 2017

😁 The solutions are pretty similar.

@Hrxn
Copy link

@Hrxn Hrxn commented Mar 21, 2017

BTW, is Pornhub still 720p max, or has anyone found a way for higher res?

@szunyi
Copy link

@szunyi szunyi commented Mar 21, 2017

Higher resolution is only for valid subscription user as I know.

@surcouf9
Copy link
Author

@surcouf9 surcouf9 commented Mar 21, 2017

THX for the quick fix. Now. How do I apply it?

Surcouf. Newbie with experience.

@twlz0ne
Copy link

@twlz0ne twlz0ne commented Mar 21, 2017

@surcouf9

$ cd /path/to/youtube-dl--git
$ git pull && git checkout -b pornhub-issue-12470
$ curl -o youtube_dl/extractor/pornhub.py https://raw.githubusercontent.com/snpwr/youtube-dl/07e5efbcb24235a70a28a4eedb88dc1e69656a38/youtube_dl/extractor/pornhub.py
$ python ./setup.py install
$ youtube-dl <url>
@szunyi
Copy link

@szunyi szunyi commented Mar 21, 2017

where will be in the next uptime?

youtube-dl -U
youtube-dl is up-to-date (2017.03.20)

@throawayagain123
Copy link

@throawayagain123 throawayagain123 commented Mar 21, 2017

@szunyi No fix has been applied to master repository yet. Once that happens it may make it into an update.

@surcouf9
Copy link
Author

@surcouf9 surcouf9 commented Mar 21, 2017

@twlz0ne @szunyi

I applied the patch as kindly instrudted by @twlz0ne . And it works!

This was my first experience at posting an issue on github. You guys are fantastic. What an asset!

Many THX.

Surcouf, le gentl corsaire from Quebec,Canada.

@dstftw dstftw closed this in 21fbf0f Mar 21, 2017
@ytdl-org ytdl-org deleted a comment from zepimp Mar 7, 2018
@ytdl-org ytdl-org locked and limited conversation to collaborators Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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