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

[Site Request] Pornhub Premium #18797

Closed
5 of 9 tasks
mjolnir870 opened this issue Jan 10, 2019 · 60 comments
Closed
5 of 9 tasks

[Site Request] Pornhub Premium #18797

mjolnir870 opened this issue Jan 10, 2019 · 60 comments

Comments

@mjolnir870
Copy link

mjolnir870 commented Jan 10, 2019

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2019.01.02. 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 2019.01.02

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: []
[debug] User config: []
[debug] Custom config: ['--no-mtime', '--no-playlist', '--playlist-reverse', '-i', '-w', '--newline', '-f', 'bestvideo+bestaudio/best', '--write-thumbnail', '--sleep-interval', '2', '--max-sleep-interval', '5']
[debug] Command-line args: ['--config-location', 'C:\\TEST\\youtube-dl-daily.conf', '--cookies', 'C:\\TEST\\c.txt', '-u', 'PRIVATE', '-p', 'PRIVATE', '--ffmpeg-location', 'C:\\TEST\\ffmpeg.exe', '--external-downloader', 'C:\\TEST\\aria2c.exe', '--external-downloader-args', '--file-allocation=none -x 4 -k 1M', '--download-archive', 'C:\\TEST\\~youtube-dl_history.txt', '-o', 'C:\\TEST\\%(upload_date)s %(title)s_%(id)s.%(ext)s', '-v', 'https://www.pornhubpremium.com/pornstar/ashley-rosi/videos/upload']
[debug] Encodings: locale cp1252, fs mbcs, out cp65001, pref cp1252
[debug] youtube-dl version 2019.01.02
[debug] Python version 3.4.4 (CPython) - Windows-8.1-6.3.9600
[debug] exe versions: ffmpeg N-90960-gbcff983dc3, ffprobe N-90960-gbcff983dc3
[debug] Proxy map: {}
[generic] upload: Requesting header
WARNING: Falling back on generic information extractor.
[generic] upload: Downloading webpage
[generic] upload: Extracting information
[download] Downloading playlist: Porn Videos Uploaded by Pornstar Ashley Rosi | Pornhub
[generic] playlist Porn Videos Uploaded by Pornstar Ashley Rosi | Pornhub: Collected 2 video ids (downloading 2 of them)
[download] Downloading video 1 of 2
[debug] Invoking downloader on 'data:"+o+"; base64,"+i+"'
[download] Sleeping 3.78 seconds...
[download] Destination: C:\TEST\NA Porn Videos Uploaded by Pornstar Ashley Rosi _ Pornhub (2)_upload-2.unknown_video
[download] 100.0% of 5.00B at  2.44KiB/s ETA 00:00
[download] 100% of 5.00B in 00:00
[download] Downloading video 2 of 2
[debug] Invoking downloader on 'data:"+o+";base64,"+i+"'
[download] Sleeping 3.25 seconds...
ERROR: Incorrect padding
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 804, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 1003, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 858, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 1636, in process_video_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 1909, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 1848, in dl
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\downloader\common.py", line 364, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\downloader\http.py", line 341, in real_download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\downloader\http.py", line 109, in establish_connection
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp5nai6j15\build\youtube_dl\YoutubeDL.py", line 2212, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 464, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 482, in _open
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 1496, in data_open
  File "C:\Python\Python34\lib\base64.py", line 554, in decodebytes
binascii.Error: Incorrect padding

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Pornhub works with youtube-dl but Pornhub Premium does not. I can provide account credentials via email if necessary. Hopefully most of the code for the normal Pornhub can be used to support Pornhub Premium.

@kgorinson
Copy link

So if you use chrome, inspect the video then search for mp4. There will be direct links to all resolutions there.

@mjolnir870
Copy link
Author

Hi, I have an account I could provide to help support this site. Is there a secure way to send credentials to whoever will be adding this support?

@ealgase
Copy link
Contributor

ealgase commented Jan 17, 2019

So if you use chrome, inspect the video then search for mp4. There will be direct links to all resolutions there.

I don't have access but do they really expose the links like that?

@mjolnir870
Copy link
Author

I don't have access but do they really expose the links like that?

Yes, there is a variable called flashvars_DIGITS that holds the video thumbnail (which has the date in the path), the video name, and all the links to various qualities.

@mjolnir870
Copy link
Author

Hit "close and comment" instead of "comment", sorry.

@ab2525
Copy link

ab2525 commented Feb 12, 2019

Very interested in this as well! :)

@eromoe
Copy link

eromoe commented Feb 15, 2019

I also found var flashvars_DIGITS=xxxx , can parse easily .

@Fatmice
Copy link

Fatmice commented May 11, 2019

[debug] Command-line args: ['--no-check-certificate', '--user-agent', 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0', '--username', 'PRIVATE', '--password', 'PRIVATE', '--verbose', '-F', 'https://www.pornhubpremium.com/view_video.php?viewkey=ph5b3bc29089752']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.04.24
[debug] Python version 3.7.3 (CPython) - Linux-5.0.11-200.fc29.x86_64-x86_64-with-fedora-29-Twenty_Nine
[debug] exe versions: ffmpeg 4.0.4, ffprobe 4.0.4, phantomjs 2.1.1
[debug] Proxy map: {}
[generic] view_video: Requesting header
[redirect] Following redirect to https://www.pornhubpremium.com/premium/login?redirect=ajio9JNFG11sQNlzjDEPZaMGpF5BupJ3yXeQG2bRP7bfX7DnY4A7fqyz0fmmcP00FCSAVHH6xDXJKqFetWNQgg..
[generic] login?redirect=ajio9JNFG11sQNlzjDEPZaMGpF5BupJ3yXeQG2bRP7bfX7DnY4A7fqyz0fmmcP00FCSAVHH6xDXJKqFetWNQgg.: Requesting header
WARNING: Falling back on generic information extractor.
[generic] login?redirect=ajio9JNFG11sQNlzjDEPZaMGpF5BupJ3yXeQG2bRP7bfX7DnY4A7fqyz0fmmcP00FCSAVHH6xDXJKqFetWNQgg.: Downloading webpage
[generic] login?redirect=ajio9JNFG11sQNlzjDEPZaMGpF5BupJ3yXeQG2bRP7bfX7DnY4A7fqyz0fmmcP00FCSAVHH6xDXJKqFetWNQgg.: Extracting information
ERROR: Unsupported URL: https://www.pornhubpremium.com/premium/login?redirect=ajio9JNFG11sQNlzjDEPZaMGpF5BupJ3yXeQG2bRP7bfX7DnY4A7fqyz0fmmcP00FCSAVHH6xDXJKqFetWNQgg..
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 795, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 529, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.7/site-packages/youtube_dl/extractor/generic.py", line 3320, in _real_extract
    raise UnsupportedError(url)
youtube_dl.utils.UnsupportedError: Unsupported URL: https://www.pornhubpremium.com/premium/login?redirect=ajio9JNFG11sQNlzjDEPZaMGpF5BupJ3yXeQG2bRP7bfX7DnY4A7fqyz0fmmcP00FCSAVHH6xDXJKqFetWNQgg...

It always redirects even with cookies files
If you try to download via direct link you will get 403 error

@ealgase
Copy link
Contributor

ealgase commented May 11, 2019

Of course it does, the site isn't supported.

@procule
Copy link

procule commented May 28, 2019

Here's how while passing the right cookies:

In the view_video.php:
<div id="player" class="original mainPlayerDiv" data-video-id="5959595959">

Javascript var: flashvars_5959595959

It has the quality_xxxxp attributes (1080p, 760p, etc).
Direct links to the videos.

i.e.:

quality_1080p: "https: //dv2.phprcdn.com/videos/xxxxxx/xxx/5959595959/1080P_4000K_5959595959.mp4?ttl=1559034002&ri=51200000&rs=400000&hash=shahash"

@frosty939
Copy link

im actually kinda shocked this site wasn't one of the first sites people had working

now i have to wait for my premium account to wear off to dl stuff again :'(

@ealgase
Copy link
Contributor

ealgase commented Jul 1, 2019

im actually kinda shocked this site wasn't one of the first sites people had working

now i have to wait for my premium account to wear off to dl stuff again :'(

Or you could just support it yourself, the instructions on how to are in this thread.

@frosty939
Copy link

im actually kinda shocked this site wasn't one of the first sites people had working
now i have to wait for my premium account to wear off to dl stuff again :'(

Or you could just support it yourself, the instructions on how to are in this thread.

im a little (or maybe a lot lol) slow.. but the only thing im seeing in this thread, is a way to get the direct link from the thumbnail?

or is that what you meant? just going back after you find a video, pulling out the real link, then saving it?

@ealgase
Copy link
Contributor

ealgase commented Jul 8, 2019

@frosty939

So if you use chrome, inspect the video then search for mp4. There will be direct links to all resolutions there.

@theblazedengineer
Copy link

Did you guys review traffic on a pr0nhub premium video? For their premium content they use TS segments that are only a few seconds long. I don't think youtube-dl is setup to do this right now.

@ealgase
Copy link
Contributor

ealgase commented Jul 13, 2019

Did you guys review traffic on a pr0nhub premium video? For their premium content they use TS segments that are only a few seconds long. I don't think youtube-dl is setup to do this right now.

youtube-dl downloads MPEG-TS perfectly fine.

@Hrxn
Copy link

Hrxn commented Jul 14, 2019

What is it now? TS? MP4? Both?

@ytdl-org ytdl-org deleted a comment from theblazedengineer Jul 22, 2019
@theblazedengineer
Copy link

Why was my comment deleted? Would've been great to get some feedback as to why the team decided to delete that comment. Perhaps, because I sent a URL for testing? Well I won't do that then. But if you check a free video from that site it's using MP4 in a single chunk. If you use the Premium service it uses TS segments.

@Hrxn
Copy link

Hrxn commented Jul 27, 2019

Probably because nothing new of value has been added to the conversation in here.

I don't know, I haven't seen the comment. But that's the general guideline here, basically.

The thing is, we now have conflicting statements in this thread. The contradiction whether those linked MP4 streams are full versions, or not. Both can't be true at the same time, obviously (exceptions apply).

@theblazedengineer
Copy link

theblazedengineer commented Jul 28, 2019

I see the mention of a flashvars_DIGITS variable that can be parsed with full mp4. I no longer have access to premium so I'll have to confirm at a later time. However, when I was checking previously I can confirm that they are using TS segments for traditional video playback when you load a video on the premium version of the website. The free website we all know and love does indeed use a full mp4 during the same playback. If they are including full mp4 links in a variable for the premium service my guess is that it's just poor coding or security practices and may be removed at any point in the future. When you start a premium video also open up the network monitor in Chrome and it's very obvious that TS segments are being downloaded for playback instead of relying on a single mp4 file like the free version does.

@ealgase
Copy link
Contributor

ealgase commented Aug 4, 2019

This isn't even relevant, because both mp4 and mpeg-ts are supported and both formats should be extracted, if available

@twaddington
Copy link
Contributor

twaddington commented Aug 18, 2019

I'm working on adding support for PornHubPremium.com.

This requires overhauling the pornhub.py extractor. However, I've already got most of the functionality working. I just need to add support for downloading playlists and clean things up a bit.

Subscribe to this issue for updates.

@frosty939
Copy link

any update on this?

the old manual way doesn't seem to work anymore, or i just forgot how to do it correctly.. its been quite a while since i tried. but all the direct download urls seem to be empty
(assuming they were indeed the "videoUrl": "" parts in the media definitions)

example:

var flashvars_133469371 = {
        "maxInitialBufferLength": 40,
        "disable_sharebar": 0,
        "htmlPauseRoll": "false",
        "htmlPostRoll": "false",
        "errorReports": "https:\/\/www.pornhubpremium.com\/video\/problems\/133469371",
        "autoplay": "true",
        "autoreplay": "false",
        "video_unavailable": "false",
        "pauseroll_url": "",
        "postroll_url": "",
        "embedCode": "<iframe src=\"https:\/\/www.pornhub.com\/embed\/ph59c12c7cee9e0\" frameborder=\"0\" width=\"560\" height=\"340\" scrolling=\"no\" allowfullscreen><\/iframe>",
        "hidePostPauseRoll": true,
        "isHD": "true",
        "video_duration": "2470",
        "actionTags": "Toy:112,Toy:719,Blowjob:1063,Missionary:1343,Doggystyle:1653,Reverse Cowgirl:1912,Sex:2200,Creampie:2387",
        "link_url": "https:\/\/www.pornhubpremium.com\/view_video.php?viewkey=ph59c12c7cee9e0",
        "related_url": "https:\/\/www.pornhubpremium.com\/video\/player_related_datas?id=133469371",
        "image_url": "https:\/\/di.phprcdn.com\/videos\/201709\/19\/133469371\/thumbs_40\/(m=eaAaGwObaaaa)(mh=ABlqYTrO-D_vKW5R)1.jpg",
        "video_title": "BANG Real Teens: Aurora Belle Gets Creampied",
        "defaultQuality": [720, 480, 240, 1080],
        "mediaDefinitions": [{
            "defaultQuality": false,
            "format": "mp4",
            "quality": "1080",
            "videoUrl": ""
        }, {

@twaddington
Copy link
Contributor

twaddington commented Nov 6, 2019

@frosty939 I have a working branch in my fork. I just need to finish reimplementing support for playlists.

https://github.com/twaddington/youtube-dl/commits/phpremium

I can try to carve out some time to wrap this up.

@blackbudsnrose
Copy link

@twaddington Hey man, I am somewhat new to this. Any help on how to use the pornhub premium extractor in youtube dl? I have your extractors.py and pornhub.py extractor file downloaded, not sure how to use them to get these missing links though. Any help is much appreciated.

@thiiiick
Copy link

thiiiick commented Jan 4, 2020

@twaddington, thanks for the work. I'm receiving the following errors. I will try to dig into it, but pretty unfamiliar with stuff at this point.

$ youtube-dl --username XXXXXXX --password XXXXXXX --verbose https://www.pornhubpremium.com/view_video.php?viewkey=XXXXXXXXXXXXXXX
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'--verbose', u'https://www.pornhubpremium.com/view_video.php?viewkey=XXXXXXXXXXXXXXX']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.08.13
[debug] Python version 2.7.16 (CPython) - CYGWIN_NT-10.0-17763-3.1.2-340.x86_64-x86_64-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[PornHubPremium] Downloading login page
[PornHubPremium] Logging in to pornhubpremium.com
[PornHubPremium] ph5c15a24836a8e: Downloading webpage
[PornHubPremium] ph5c15a24836a8e: Downloading webpage
ERROR: Unable to extract encoded 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 796, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/pornhub.py", line 404, in _real_extract
    return self._extract_video(host, video_id)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/pornhub.py", line 274, in _extract_video
    'encoded url').split(';')
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1005, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract encoded 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.
`

@8bitgigo
Copy link

8bitgigo commented Feb 8, 2020

Your Feb 2nd commit works well. It is accurate, fast, and it logs in when it needs to. Great work.

I am not, however, able to download a playlist. I may not have the syntax correct, but have tried more than a dozen of different combinations of in the command.

I can say that it successfully downloads the first file of the playlist and then happily quits with out an error. I know, from current customer requests, that after each file is played/downloaded; the browser does some sort of a refresh. This is what prevents viewing a playlist (in full screen or "large windowed") natively on the site. At the end of each video, the browser "refreshes" and defaults to a 640x480 windowed display.

If you have any advice for getting a playlist working, let me know.

Thanks for getting this working!

@twaddington
Copy link
Contributor

@8bitgigo playlist support is what's holding this up. I need to finish implementing that before I can put up a pull-request. There are a lot of different permutations to support.

@thiiiick
Copy link

thiiiick commented Feb 9, 2020

Surely you are some kind of god. It’s working well on single videos. Thank you again.

@twaddington
Copy link
Contributor

Okay, playlist support is working and should be much improved. I will open a pull-request tomorrow to see about getting this work merged upstream into master.

@mindjek07
Copy link

Still waiting for update

@twaddington
Copy link
Contributor

twaddington commented Mar 8, 2020

Update: The maintainers don't seem likely to accept a large refactor of the pornhub extractor. So, I'm going to take a crack at a very limited implementation of pornhubpremium and pornhub login support to see if I can get it accepted.

In the meantime, you can use the working implementation in my fork here:
https://github.com/twaddington/youtube-dl/tree/phpremium

@twaddington
Copy link
Contributor

I have two more surgical changes ready to go that implement login support. Waiting on the first to be reviewed now.

@twaddington
Copy link
Contributor

Quick update: I merged a PR that allows you to access pornhubpremium.com using a --cookies file.

I have another PR up that adds full login support. I'm currently negotiating with the maintainers about the best way to implement this.

@ampersham
Copy link

While logged into Pornhub Premium, the user must use the domain name pornhubpremium.com. This means even publicly-available, free videos, start with the pornhubpremium.com domain name, however removing the premium part from the URL loads the public version.

YT-DL should attempt to check a video on pornhub.com when it gets a pornhubpremium.com address, which should not require authentication.

Also, because of the COVID-19 pandemic affecting the country, IP addresses from Italy are eligible for a free month of premium service. So if developers here have a VPN, you could take advantage of this for testing on the site. I tried this with PIA and it worked for me.

@kasslover530
Copy link

kasslover530 commented Mar 17, 2020

@ampersham Hello, thank you for your reply.
I did the exact same thing but encountered the following error :

[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--no-geo-bypass', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'--cookies', u'cookies.txt', u'-v', u'-o', u'%(title)s.%(ext)s', u'https://www.pornhubpremium.com/view_video.php?viewkey=ph5d5edd6f8fa93']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.03.08
[debug] Git HEAD: 68fa15155
[debug] Python version 2.7.17 (CPython) - Windows-10-10.0.18362
[debug] exe versions: none
[debug] Proxy map: {}
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\bigro\git\youtube-dl-ph-premium\youtube_dl\__main__.py", line 19, in <module>
    youtube_dl.main()
  File "youtube_dl\__init__.py", line 474, in main
    _real_main(argv)
  File "youtube_dl\__init__.py", line 464, in _real_main
    retcode = ydl.download(all_urls)
  File "youtube_dl\YoutubeDL.py", line 2019, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "youtube_dl\YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "youtube_dl\extractor\common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "youtube_dl\extractor\pornhub.py", line 238, in _real_extract
    self._login_if_required(host)
  File "youtube_dl\extractor\pornhub.py", line 68, in _login_if_required
    cookies = self._get_cookies('https://%s' % host)
  File "youtube_dl\extractor\common.py", line 2831, in _get_cookies
    return compat_cookies.SimpleCookie(req.get_header('Cookie'))
  File "C:\Python27\lib\Cookie.py", line 583, in __init__
    if input: self.load(input)
  File "C:\Python27\lib\Cookie.py", line 643, in load
    for k, v in rawdata.items():
AttributeError: 'unicode' object has no attribute 'items'

I printed the webpage and it showed the 'login PHPremium' page.

Could you share the command you ran to make it work?

Thanks.

EDIT : please ignore, my cookies were not properly set.

@twaddington
Copy link
Contributor

twaddington commented Mar 17, 2020

Support for pornhubpremium logins is implemented and working in a branch, but not yet merged to master.

If you're eager for this support please comment on the pull-request and ask the maintainers to merge the change.

@ampersham
Copy link

@ampersham Hello, thank you for your reply.
I did the exact same thing but encountered the following error :

[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--no-geo-bypass', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'--cookies', u'cookies.txt', u'-v', u'-o', u'%(title)s.%(ext)s', u'https://www.pornhubpremium.com/view_video.php?viewkey=ph5d5edd6f8fa93']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.03.08
[debug] Git HEAD: 68fa15155
[debug] Python version 2.7.17 (CPython) - Windows-10-10.0.18362
[debug] exe versions: none
[debug] Proxy map: {}
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\bigro\git\youtube-dl-ph-premium\youtube_dl\__main__.py", line 19, in <module>
    youtube_dl.main()
  File "youtube_dl\__init__.py", line 474, in main
    _real_main(argv)
  File "youtube_dl\__init__.py", line 464, in _real_main
    retcode = ydl.download(all_urls)
  File "youtube_dl\YoutubeDL.py", line 2019, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "youtube_dl\YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "youtube_dl\extractor\common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "youtube_dl\extractor\pornhub.py", line 238, in _real_extract
    self._login_if_required(host)
  File "youtube_dl\extractor\pornhub.py", line 68, in _login_if_required
    cookies = self._get_cookies('https://%s' % host)
  File "youtube_dl\extractor\common.py", line 2831, in _get_cookies
    return compat_cookies.SimpleCookie(req.get_header('Cookie'))
  File "C:\Python27\lib\Cookie.py", line 583, in __init__
    if input: self.load(input)
  File "C:\Python27\lib\Cookie.py", line 643, in load
    for k, v in rawdata.items():
AttributeError: 'unicode' object has no attribute 'items'

I printed the webpage and it showed the 'login PHPremium' page.

Could you share the command you ran to make it work?

Thanks.

EDIT : please ignore, my cookies were not properly set.

sorry know i was describing an issue related to PH premium. should i make a new seperate issue?

@xoryouyou
Copy link

Also, because of the COVID-19 pandemic affecting the country, IP addresses from Italy are eligible for a free month of premium service. So if developers here have a VPN, you could take advantage of this for testing on the site. I tried this with PIA and it worked for me.

https://www.pornhub.com/stayhome pornhub extended free premium to the whole world.

@VaibhavNarang
Copy link

So if you use chrome, inspect the video then search for mp4. There will be direct links to all resolutions there.

I don't have access but do they really expose the links like that?

yes, they do. i just downloaded a premium video using inspect.

@ArghKevin
Copy link

ArghKevin commented Apr 9, 2020

@RedKingSlayer didnt find any video links in inspect, @twaddington i got this error on your verison after deleting usr/local/bin/youtube-dl, installing from your fork using sudo python setup.py develop, and running youtube-dl -u xxxx -p xxxx https://www.pornhubpremium.com/view_video.php?viewkey=ph5d9720c6080d1
"pornhub premium requires authentification"
is this due to the current status of your fork or is it me being incompetent?

@VaibhavNarang
Copy link

VaibhavNarang commented Apr 9, 2020

@ArghKevin on some videos, they try to hide the links by breaking them into pieces. This seems to be the case in your provided link. Look for 'var flashvars_XXXX' in script when you inspect. In this they have broken the links into various variables if you scroll down a bit. Looks something like this -

var ra252658741ra75ra252658741ra75="_252658741";var raec0kiqe21era81raec0kiqe21era81="EC0KiqE" + "21E";var ra59saglzcdra98ra59saglzcdra98="59SAGLzC-D";var ramu1sayjcoira44ramu1sayjcoira44="mU1SayJ" + "coI";var raxmxo3egpwnra15raxmxo3egpwnra15="xMxo3Eg" + "Pwn";var ra20191004ra48ra20191004ra48="201910/04/";var rasydsayw1i8ra84rasydsayw1i8ra84="sYDSaYW1I8";var rar9yq3mtoera29rar9yq3mtoera29="r9Yq3mT" + "o_E";var rauzpodwlghura45rauzpodwlghura45="uZpOdWl" + "GHU";var ramp4vuy7vra77ramp4vuy7vra77=".mp4?vu" + "y7V";var rahttpscvra15rahttpscvra15="https://cv";var ragloaivbebra62ragloaivbebra62="GLOAI-vBeB";var ra7s5txdhwzjra51ra7s5txdhwzjra51="7s5TXdHwz" + "J";var rascvmzxztbxra100rascvmzxztbxra100="ScvmZXzTbX";var ra720p4000kra46ra720p4000kra46="720P_40" + "00K";var ra4lxv0r0me4ra38ra4lxv0r0me4ra38="4lXv0R0Me4";var rawdsg8xorsnra26rawdsg8xorsnra26="wdsg8xORsn";var raifqgweuxf4ra94raifqgweuxf4ra94="IFqgWEuXf4";var ra252658741ra21ra252658741ra21="25265" + "8741/";var rao0uyrcokgvra74rao0uyrcokgvra74="o0UYr" + "CokGV";var ra3wpra26ra3wpra26="3wP";var ra7ugga2ryvsra29ra7ugga2ryvsra29="7UGgA2ryV" + "s";var ra6e7jklhmw8ra18ra6e7jklhmw8ra18="6E7jKLhmW" + "8";var rajlipvwm9kira23rajlipvwm9kira23="JlIpvWM9k" + "I";var raphprcdncra95raphprcdncra95=".phprcdn.c";var rageml4zc7kra67rageml4zc7kra67="gEMl4Z_C7k";var raomvideosra17raomvideosra17="om/videos/";var rare2xkxqabsra36rare2xkxqabsra36="re2XKXQaBS";var raxwvkobwj9ra80raxwvkobwj9ra80="xWv_KobWJ9";

The order that has to be put in is given just there as well. If you know a little bit of JavaScript, its a piece of cake to put the link back together!

@ArghKevin
Copy link

ArghKevin commented Apr 9, 2020

@RedKingSlayer so in this case should i combine some if the =" " portions in order to complete the link? or do i need to look deeper into the elements in order to complete what seems to be the 720p link

@VaibhavNarang
Copy link

VaibhavNarang commented Apr 9, 2020

@ArghKevin yup, you have to find the order though ! Just beside this code there should be something like -
/* hrbdksiis */+hdjdjdjs+/ * jeejejjeej */

What i do is, put this in console.log() command and the link gets printed onto my console. (I use visual studio code to run this .js file)

Edit : Here, i combined the link for you this time -
https://cv.phprcdn.com/videos/201910/04/252658741/1080P_4000K_252658741.mp4?H8G88f8EVcTWRnc4UiaXx1UWvIZEM6pCPEZ8Qb5uQEYu_MQs-UGjGJhCvv4Uc4Qz1itkHuU4TBlxhdY7FG0v5lpxto-3CTvM9Pbo2q45lJwmj4v8E20zAlHgcA4nveJGLNO5Q6oHlLWSHoUsNTLCphgIGNCSv8ft3nJt0MQyUqv0RfKblIgBvWNNEj88NsbEbLZaE2knd0gb1GP81w

@twaddington
Copy link
Contributor

twaddington commented Apr 9, 2020

"pornhub premium requires authentification"
is this due to the current status of your fork or is it me being incompetent? — @ArghKevin

Which branch are you using?

The full error in my branch should be the following:

PornHub Premium requires authentication. You may want to use --cookies or --netrc.

If you don't see that full error text, then you're still invoking the wrong version of youtube-dl.

@Agent076537
Copy link

Hey @twaddington

Would you mind taking a look at the following Issue I raised (which someone immediately closed)? You seem keen on getting this site working

#24939

Cheers

@twaddington
Copy link
Contributor

@Agent076537 yep, that isn't a premium specific issue. That creator hasn't uploaded any videos, only other channels referencing her, so /videos doesn't exist. I'd recommend creating a new issue and make sure you reference pornhub.com links, not premium. For example: https://www.pornhub.com/pornstar/gabbie-carter

@twaddington
Copy link
Contributor

twaddington commented Apr 22, 2020

@Agent076537 additionally, it looks like downloading the playlist isn't working right:

https://www.pornhub.com/view_video.php?viewkey=ph5e864fbb37980&pkey=sys%3Apornstar%3A306792%3Amr%3A0

This looks like a separate bug you could file.

@Agent076537
Copy link

@twaddington thanks I'll do that. Is it worth making one for her premium page to be "https://www.pornhubpremium.com/pornstar/gabbie-carter?premium=1&o=mr" rather than /videos/premium or will that just get closed again ??

@twaddington
Copy link
Contributor

@twaddington thanks I'll do that. Is it worth making one for her premium page to be "https://www.pornhubpremium.com/pornstar/gabbie-carter?premium=1&o=mr" rather than /videos/premium or will that just get closed again ??

No. The problem is the same for pornhub.com and pornhubpremium.com. Premium is not supported by the maintainers yet so that's why they closed your issue.

@dstftw dstftw closed this as completed in e22ff4e Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet