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] Album extraction not working at the moment #4301

Closed
Hrxn opened this issue Jul 14, 2023 · 11 comments
Closed

[PornHub] Album extraction not working at the moment #4301

Hrxn opened this issue Jul 14, 2023 · 11 comments

Comments

@Hrxn
Copy link
Contributor

Hrxn commented Jul 14, 2023

Just tested with the example/test URL from pornhub.py

PS C:\Apps\Temp> gallery-dl --ignore-config --verbose 'https://www.pornhub.com/album/19289801'
[gallery-dl][debug] Version 1.25.7
[gallery-dl][debug] Python 3.11.4 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.31.0 - urllib3 2.0.3
[gallery-dl][debug] Configuration Files []
[gallery-dl][debug] Starting DownloadJob for 'https://www.pornhub.com/album/19289801'
[pornhub][debug] Using PornhubGalleryExtractor for 'https://www.pornhub.com/album/19289801'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.pornhub.com:443
[urllib3.connectionpool][debug] https://www.pornhub.com:443 "GET /album/19289801 HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.pornhub.com:443 "GET /album/show_album_json?album=19289801 HTTP/1.1" 200 None
[pornhub][error] An unexpected error occurred: KeyError - ''. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[pornhub][debug]
Traceback (most recent call last):
  File "C:\Users\Hrxn\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\job.py", line 96, in run
    for msg in extractor:
  File "C:\Users\Hrxn\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\pornhub.py", line 63, in items
    for num, image in enumerate(self.images(), 1):
  File "C:\Users\Hrxn\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\pornhub.py", line 103, in images
    img = images[key]
          ~~~~~~^^^^^
KeyError: ''
PS C:\Apps\Temp>

I think the release version should be fine here, I'm not seeing any commits related to PornHub since, no?

@mikf
Copy link
Owner

mikf commented Jul 14, 2023

This should be a general error since it is caused by the new(?) "Age Verification" page that gets shown when visiting for the first time and the accessAgeDisclaimerPH cookie isn't set.

As a temporary workaround: -o cookies.accessAgeDisclaimerPH=1
This will be fixed in commit 20da410 when I do the next git push

@Hrxn
Copy link
Contributor Author

Hrxn commented Jul 14, 2023

Thanks for the quick fix, cheers!

@Hrxn Hrxn closed this as completed Jul 14, 2023
@Hrxn
Copy link
Contributor Author

Hrxn commented Jul 22, 2023

@mikf Sorry, me again, but I noticed something unusual here, I think..

I think this "Age Verification" cookie thing works now, but trying this example gallery again, it downloads the first image, and then apparently fails immediately at the next one?

Not sure what to make of this. But it does not seem to touch any recent changes in the source code here, as far as I can see..

PS C:\Apps\Temp> gallery-dl --config-ignore 'https://www.pornhub.com/album/19289801'
* .\gallery-dl\pornhub\Danika Mori\19289801 Danika Mori Best Moments\001_339302351.jpg
[pornhub][error] An unexpected error occurred: KeyError - 339302381. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
PS C:\Apps\Temp> gallery-dl --config-ignore 'https://www.pornhub.com/album/19289801' --verbose
[gallery-dl][debug] Version 1.25.8
[gallery-dl][debug] Python 3.11.4 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.31.0 - urllib3 2.0.4
[gallery-dl][debug] Configuration Files []
[gallery-dl][debug] Starting DownloadJob for 'https://www.pornhub.com/album/19289801'
[pornhub][debug] Using PornhubGalleryExtractor for 'https://www.pornhub.com/album/19289801'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.pornhub.com:443
[urllib3.connectionpool][debug] https://www.pornhub.com:443 "GET /album/19289801 HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.pornhub.com:443 "GET /album/show_album_json?album=19289801 HTTP/1.1" 200 None
# .\gallery-dl\pornhub\Danika Mori\19289801 Danika Mori Best Moments\001_339302351.jpg
[pornhub][error] An unexpected error occurred: KeyError - 339302381. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[pornhub][debug]
Traceback (most recent call last):
  File "C:\Users\Hrxn\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\job.py", line 96, in run
    for msg in extractor:
  File "C:\Users\Hrxn\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\pornhub.py", line 66, in items
    for num, image in enumerate(self.images(), 1):
  File "C:\Users\Hrxn\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\pornhub.py", line 106, in images
    img = images[key]
          ~~~~~~^^^^^
KeyError: 339302381
PS C:\Apps\Temp>

@Hrxn Hrxn reopened this Jul 22, 2023
@Hrxn
Copy link
Contributor Author

Hrxn commented Jul 22, 2023

Okay, I've also tried the profile example URL (https://www.pornhub.com/pornstar/danika-mori/photos), and it seems to resemble the issue described - this profile has 9 albums, and gallery-dl downloaded the first picture of each of them, apparently..
Some weird off-by-one error, maybe?

mikf added a commit that referenced this issue Jul 22, 2023
@mikf
Copy link
Owner

mikf commented Jul 22, 2023

Should be fixed with 088e8d5.
They changes the type of some values from integer to string or vice-versa.

@Hrxn
Copy link
Contributor Author

Hrxn commented Jul 22, 2023

Well. it did the trick, apparently...

PS C:\Apps\Temp\gallery-dl-master\gallery_dl> python.exe .\__main__.py 'https://www.pornhub.com/album/76104691' -d "."
.\PornHub\Galleries\Unsorted\Danika.Mori\Light.on.Danika.Mori.(76104691)\0001_834702881.jpg
.\PornHub\Galleries\Unsorted\Danika.Mori\Light.on.Danika.Mori.(76104691)\0002_834724911.jpg
.\PornHub\Galleries\Unsorted\Danika.Mori\Light.on.Danika.Mori.(76104691)\0003_834724941.jpg
.\PornHub\Galleries\Unsorted\Danika.Mori\Light.on.Danika.Mori.(76104691)\0004_834724971.jpg
.\PornHub\Galleries\Unsorted\Danika.Mori\Light.on.Danika.Mori.(76104691)\0005_834724921.jpg
PS C:\Apps\Temp\gallery-dl-master\gallery_dl>

Thank you for the quick fix, closing this again.
Cheers!

@Hrxn Hrxn closed this as completed Jul 22, 2023
@mikeymatrix70
Copy link

Should be fixed with 088e8d5. They changes the type of some values from integer to string or vice-versa.

Is there anyway to get this working without using the --ignore-config option? When using a working config the key error issue still comes up and stops downloading

@Hrxn
Copy link
Contributor Author

Hrxn commented Aug 22, 2023

What do you mean?

I just tested it (with my normal config), it is still working as expected?

@Hrxn
Copy link
Contributor Author

Hrxn commented Aug 22, 2023

Did you forget to use something like {num:>04}.{id} in your "filename" setting?

@Hrxn
Copy link
Contributor Author

Hrxn commented Aug 24, 2023

@mikeymatrix70 In case you were not aware, the fix for this issue here (088e8d5) is not in the latest released version (v1.25.8), it came a bit later.

So make sure to run the dev version, or run directly from source.

@mikeymatrix70
Copy link

@mikeymatrix70 In case you were not aware, the fix for this issue here (088e8d5) is not in the latest released version (v1.25.8), it came a bit later.

So make sure to run the dev version, or run directly from source.

Thank you! I confirm working great in 1.26.0-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants