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

[PornHub] Title Cannot Be Extracted #17197

Closed
MyPersonalKov opened this issue Aug 9, 2018 · 8 comments
Closed

[PornHub] Title Cannot Be Extracted #17197

MyPersonalKov opened this issue Aug 9, 2018 · 8 comments

Comments

@MyPersonalKov
Copy link

@MyPersonalKov MyPersonalKov commented Aug 9, 2018

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 2018.08.04. 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 2018.08.04

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: []
[debug] Command-line args: ['--download-archive', 'C:/Users/gpjaz/Documents/youtube-dl/p_downloads.txt', 'https://www.pornhub.com/users/tweetney/videos/public', '--verbose', '--dump-pages']
[debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252
[debug] youtube-dl version 2018.08.04
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17134
[debug] exe versions: ffmpeg N-91141-gc24d247e2c, ffprobe N-91141-gc24d247e2c
[debug] Proxy map: {}
[PornHubUserVideos] tweetney: Downloading page 2
[download] Downloading playlist: tweetney
[PornHubUserVideos] playlist tweetney: Collected 13 video ids (downloading 13 of them)
[download] Downloading video 1 of 13
[PornHub] ph5b5d6ea592d2a: Downloading pc webpage
[PornHub] Dumping request to http://www.pornhub.com/view_video.php?viewkey=ph5b5d6ea592d2a
PGh0bWw+PGhlYWQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPjwhLS0KZnVuY3Rpb24gbGVhc3RGYWN0b3IobikgewogaWYgKGlzTmFOKG4pIHx8ICFpc0Zpbml0ZShuKSkgcmV0dXJuIE5hTjsKIGlmICh0eXBlb2YgcGhhbnRvbSAhPT0gJ3VuZGVmaW5lZCcpIHJldHVybiAncGhhbnRvbSc7CiBpZiAodHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCcgJiYgbW9kdWxlLmV4cG9ydHMpIHJldHVybiAnbm9kZSc7CiBpZiAobj09MCkgcmV0dXJuIDA7CiBpZiAobiUxIHx8IG4qbjwyKSByZXR1cm4gMTsKIGlmIChuJTI9PTApIHJldHVybiAyOwogaWYgKG4lMz09MCkgcmV0dXJuIDM7CiBpZiAobiU1PT0wKSByZXR1cm4gNTsKIHZhciBtPU1hdGguc3FydChuKTsKIGZvciAodmFyIGk9NztpPD1tO2krPTMwKSB7CiAgaWYgKG4laT09MCkgICAgICByZXR1cm4gaTsKICBpZiAobiUoaSs0KT09MCkgIHJldHVybiBpKzQ7CiAgaWYgKG4lKGkrNik9PTApICByZXR1cm4gaSs2OwogIGlmIChuJShpKzEwKT09MCkgcmV0dXJuIGkrMTA7CiAgaWYgKG4lKGkrMTIpPT0wKSByZXR1cm4gaSsxMjsKICBpZiAobiUoaSsxNik9PTApIHJldHVybiBpKzE2OwogIGlmIChuJShpKzIyKT09MCkgcmV0dXJuIGkrMjI7CiAgaWYgKG4lKGkrMjQpPT0wKSByZXR1cm4ga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R: Unable to extract title; 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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpckoq891b\build\youtube_dl\YoutubeDL.py", line 792, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpckoq891b\build\youtube_dl\extractor\common.py", line 502, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpckoq891b\build\youtube_dl\extractor\pornhub.py", line 164, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpckoq891b\build\youtube_dl\extractor\common.py", line 972, in _search_regex
youtube_dl.utils.RegexNotFoundError: Unable to extract title; 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.
...
<end of log>

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

When trying to download videos based on Pornhub User, an exception is thrown stating that the title cannot be extracted. I have upgraded to the latest version and tested again. The problem still stands. This problem also occurs when using the -a flag for batch files.

@MyPersonalKov
Copy link
Author

@MyPersonalKov MyPersonalKov commented Aug 9, 2018

Updated issue with --dump-pages.

@fluver
Copy link

@fluver fluver commented Aug 10, 2018

looks like pH added some javascript which needs to be executed before the "real" page is loaded.
replacing

        def dl_webpage(platform):
            self._set_cookie('pornhub.com', 'platform', platform)
            return self._download_webpage(
                'http://www.pornhub.com/view_video.php?viewkey=%s' % video_id,
                video_id, 'Downloading %s webpage' % platform)

        webpage = dl_webpage('pc')

in pornhub.py
with a javascript enabled webscraper like selenium+chrome solves the problem

        from selenium import webdriver
        driver = webdriver.Chrome()
        driver.get('http://www.pornhub.com/view_video.php?viewkey=%s' % video_id)
        webpage = driver.page_source

dont know if a dependency on selenium and a "big" webdriver is what you want...

@MyPersonalKov
Copy link
Author

@MyPersonalKov MyPersonalKov commented Aug 12, 2018

What's strange is that if I download the videos directly, it works. It would seem like I'm only getting this when I either try to use a batch file or pull the videos from the user profile.

@mjolnir870
Copy link

@mjolnir870 mjolnir870 commented Aug 13, 2018

The new javascript before the "real" page load doesn't always seem to be there. Sometimes pages load without it for me.

@RCcola1987
Copy link

@RCcola1987 RCcola1987 commented Aug 13, 2018

I'm seeing something similar. When trying to download all videos from a user's public videos for example:
if they have 500 videos ytdl will see the correct number of vids to pull but will fail on 80-90% of them with the title extract error caused by the javascript. whats even more interesting if you run the same command again it will fail on different videos. so in effect, you CAN get all the videos but it can take hundreds of runs to get all of them.

@MyPersonalKov
Copy link
Author

@MyPersonalKov MyPersonalKov commented Aug 16, 2018

Yeah. I think it gave back 13 video IDs. I think I was able to get 3 videos. 80-90% seems accurate.

@PriyankVashiar
Copy link

@PriyankVashiar PriyankVashiar commented Jan 1, 2019

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.pornhub.com/view_video.php?viewkey=ph5bcc729418e44']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.12.31
[debug] Python version 3.6.5 (CPython) - Linux-4.15.0-43-generic-x86_64-with-debian-buster-sid
[debug] exe versions: ffmpeg 3.4.4-0ubuntu0.18.04.1, ffprobe 3.4.4-0ubuntu0.18.04.1
[debug] Proxy map: {}
[PornHub] ph5bcc729418e44: Downloading pc webpage
ERROR: Unable to extract title; 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.
Traceback (most recent call last):
File "/home/priyank/anaconda3/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 793, in extract_info
ie_result = ie.extract(url)
File "/home/priyank/anaconda3/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 508, in extract
ie_result = self._real_extract(url)
File "/home/priyank/anaconda3/lib/python3.6/site-packages/youtube_dl/extractor/pornhub.py", line 171, in _real_extract
webpage, 'title', group='title')
File "/home/priyank/anaconda3/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 983, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract title; 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.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 13, 2019

Duplicate of #5930.

@dstftw dstftw closed this Jan 13, 2019
@ytdl-org ytdl-org locked and limited conversation to collaborators Jan 13, 2019
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
6 participants
You can’t perform that action at this time.