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

Pornhubpremium #21416

Closed
wants to merge 14 commits into from
Closed

Pornhubpremium #21416

wants to merge 14 commits into from

Conversation

fauresystems
Copy link

@fauresystems fauresystems commented Jun 16, 2019

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • [x ] I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • [x ] Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Add pornhubpremium.com to PornHub extractor.

Pornhub tests corrections:
# non-ASCII title
'uploader': 'Unknown',
--> 'uploader': 'unknown',
# subtitles
'url': 'https://www.pornhub.com/view_video.php?viewkey=ph5af5fef7c2aa7',
--> This video has been disabled
--> 'url': 'https://fr.pornhub.com/view_video.php?viewkey=ph5a73f8c84d1a9',

Add PornHubPremium login
@fauresystems
Copy link
Author

PornHub test were broken, so I fixed them and added PornHub Premium login, should be OK now

@fauresystems
Copy link
Author

Do I need anything to do now?

@fauresystems
Copy link
Author

fauresystems commented Jun 22, 2019 via email

Revert .gitignore commit
Maybe I am no good at github! But I am a work in progress
@fauresystems
Copy link
Author

I'm a github rookie but I guess it's okay now.

@fauresystems
Copy link
Author

I guess the only test failing is Pornhub Premium because of credentials.

@dstftw
Copy link
Collaborator

dstftw commented Jun 23, 2019

Wrong. See travis log.

@fauresystems
Copy link
Author

I fall back to previous password, sounds good now.

@fauresystems
Copy link
Author

Is test going to run automatically again, or I need to do something?

@fauresystems
Copy link
Author

fauresystems commented Jun 24, 2019 via email

Added credentials
@fauresystems
Copy link
Author

I don't know what to do with that:
Traceback (most recent call last): File "/home/travis/build/ytdl-org/youtube-dl/test/test_unicode_literals.py", line 52, in test_all_files 'unicode_literals import missing in %s' % fn) File "/home/travis/build/ytdl-org/youtube-dl/test/helper.py", line 242, in assertRegexpMatches self.assertTrue(m, msg) AssertionError: None is not true : Regexp didn't match: '(?:(?:#.*?|\\s*)\\n)*from __future__ import (?:[a-z_]+,\\s*)*unicode_literals' not found in '"""\ntest_fork.py is not added to git (only for local testing)\n"""\n\nfrom __future__ import unicode_literals\nimport youtube_dl\n\nydl_opts = {\n \'skip_download\': True,\n}\n\nwith youtube_dl.YoutubeDL(ydl_opts) as ydl:\n ydl.download([\'http://www.pornhub.com/view_video.php?viewkey=1331683002\'])\n\nexit()\n\nydl_opts = {\n \'format\': \'bestvideo[ext=mp4]+bestaudio[ext=m4a]\',\n \'username\': "tdsist",\n \'password\': "ZtOUktu0QP",\n}\n\nwith youtube_dl.YoutubeDL(ydl_opts) as ydl:\n ydl.download([\'https://fr.pornhubpremium.com/view_video.php?viewkey=ph5bdbb2cd6df6a\'])', unicode_literals import missing in /home/travis/build/ytdl-org/youtube-dl/test_fork.py

@fauresystems
Copy link
Author

Sounds OK now, you merge the request ?

Remove credentials from tests
@fauresystems
Copy link
Author

Sounds OK now without creds, you merge the request ? Or am I requested to dpo something ?

@fauresystems
Copy link
Author

fauresystems commented Jul 13, 2019 via email

@@ -48,10 +49,12 @@ def dl(*args, **kwargs):

class PornHubIE(PornHubBaseIE):
IE_DESC = 'PornHub and Thumbzilla'
_NETRC_MACHINE = 'pornhubpremium'
_LOGIN_URL = 'https://www.pornhubpremium.com/premium/login'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be a separate extractor.

})

# Successful login
if response.get("success") == '1':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes.

@@ -48,10 +49,12 @@ def dl(*args, **kwargs):

class PornHubIE(PornHubBaseIE):
IE_DESC = 'PornHub and Thumbzilla'
_NETRC_MACHINE = 'pornhubpremium'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, should be pornhub. Auth should work for non premium site as well.

'info_dict': {
'id': 'ph5af5fef7c2aa7',
'id': 'ph5a73f8c84d1a9',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all unrelated changes.

_VALID_URL = r'''(?x)
https?://
(?:
(?:[^/]+\.)?(?P<host>pornhub\.(?:com|net))/(?:(?:view_video\.php|video/show)\?viewkey=|embed/)|
(?:[^/]+\.)?(?P<host>(?:pornhub|pornhubpremium)\.(?:com|net))/(?:(?:view_video\.php|video/show)\?viewkey=|embed/)|
Copy link
Contributor

@twaddington twaddington Aug 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified as:

P<host>pornhub(?:premium)?\.

@dstftw dstftw closed this 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
Development

Successfully merging this pull request may close these issues.

3 participants