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

Patreon Extractor Gets 403 Forbidden #342

Closed
Aster-the-Med-Stu opened this issue Jul 18, 2019 · 8 comments
Closed

Patreon Extractor Gets 403 Forbidden #342

Aster-the-Med-Stu opened this issue Jul 18, 2019 · 8 comments

Comments

@Aster-the-Med-Stu
Copy link
Contributor

Verbose output:

root@comic:~/OneDrive/Downloads# gallery-dl https://www.patreon.com/mick39 --write-metadata --write-tags --write-log log.log --cookies ./cookies.txt -v
[gallery-dl][debug] Version 1.8.7
[gallery-dl][debug] Python 3.6.8 - Linux-4.15.0-54-generic-x86_64-with-Ubuntu-18.04-bionic
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.3
[gallery-dl][debug] Starting DownloadJob for 'https://www.patreon.com/mick39'
[gallery-dl][debug] updating default urllib3 ciphers
[patreon][debug] Using PatreonCreatorExtractor for 'https://www.patreon.com/mick39'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.patreon.com:443
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /mick39 HTTP/1.1" 302 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /mick39/posts HTTP/1.1" 403 None
[patreon][error] HTTP request failed:  403: Forbidden for url: https://www.patreon.com/mick39

I believe that this is not a platform-specific error as I could reproduce this on my laptop with Windows 10 and Anaconda3 installed.

Besides, the Patreon extractor is also unusable for free contents(without session_id set):

  base  ~\..\Downloads  gallery-dl https://www.patreon.com/twokinds --write-metadata --write-tags --write-log log.log -v      [gallery-dl][debug] Version 1.8.7
[gallery-dl][debug] Python 3.7.3 - Windows-10-10.0.18362-SP0
[gallery-dl][debug] requests 2.22.0 - urllib3 1.24.2
[gallery-dl][debug] Starting DownloadJob for 'https://www.patreon.com/twokinds'
[gallery-dl][debug] updating default urllib3 ciphers
[patreon][debug] Using PatreonCreatorExtractor for 'https://www.patreon.com/twokinds'
[patreon][warning] no 'session_id' cookie set
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.patreon.com:443
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /twokinds HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/posts?include=user,attachments,user_defined_tags,campaign,poll.choices,poll.current_user_responses.user,poll.current_user_responses.choice,poll.current_user_responses.poll,access_rules.tier.null&fields[post]=change_visibility_at,comment_count,content,current_user_can_delete,current_user_can_view,current_user_has_liked,embed,image,is_paid,like_count,min_cents_pledged_to_view,post_file,published_at,patron_count,patreon_url,post_type,pledge_url,thumbnail_url,teaser_text,title,upgrade_url,url,was_posted_by_campaign_owner&fields[user]=image_url,full_name,url&fields[campaign]=avatar_photo_url,earnings_visibility,is_nsfw,is_monthly,name,url&fields[access_rule]=access_rule_type,amount_cents&sort=-published_at&filter[is_draft]=false&filter[contains_exclusive_posts]=true&filter[campaign_id]=145535&json-api-use-default-includes=false&json-api-version=1.0 HTTP/1.1" 403 None
[patreon][error] HTTP request failed:  403: Forbidden for url: https://www.patreon.com/api/posts?include=user,attachments,user_defined_tags,campaign,poll.choices,poll.current_user_responses.user,poll.current_user_responses.choice,poll.current_user_responses.poll,access_rules.tier.null&fields[post]=change_visibility_at,comment_count,content,current_user_can_delete,current_user_can_view,current_user_has_liked,embed,image,is_paid,like_count,min_cents_pledged_to_view,post_file,published_at,patron_count,patreon_url,post_type,pledge_url,thumbnail_url,teaser_text,title,upgrade_url,url,was_posted_by_campaign_owner&fields[user]=image_url,full_name,url&fields[campaign]=avatar_photo_url,earnings_visibility,is_nsfw,is_monthly,name,url&fields[access_rule]=access_rule_type,amount_cents&sort=-published_at&filter[is_draft]=false&filter[contains_exclusive_posts]=true&filter[campaign_id]=145535&json-api-use-default-includes=false&json-api-version=1.0
@ghost
Copy link

ghost commented Jul 18, 2019

had you tried to install pyOpenSSL?
pip3 pyopenssl
It might solve your problem.

@Aster-the-Med-Stu
Copy link
Contributor Author

Aster-the-Med-Stu commented Jul 19, 2019

@ucok66 Er... Both on my Ubuntu server and Anaconda in Windows have pyopenssl installed.

And could you kindly test downloading something from Patreon on your machine?

@ghost
Copy link

ghost commented Jul 19, 2019

[ucok66@ucok66 ~]$ gallery-dl -v https://www.patreon.com/vytz
[gallery-dl][debug] Version 1.9.0-dev
[gallery-dl][debug] Python 3.7.3 - Linux-5.2.1-1-MANJARO-x86_64-with-arch-Manjaro-Linux
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.3
[gallery-dl][debug] Starting DownloadJob for 'https://www.patreon.com/vytz'
[patreon][debug] Using PatreonCreatorExtractor for 'https://www.patreon.com/vytz'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.patreon.com:443
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /vytz HTTP/1.1" 302 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /vytz/posts HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/posts?include=user,attachments,user_defined_tags,campaign,poll.choices,poll.current_user_responses.user,poll.current_user_responses.choice,poll.current_user_responses.poll,access_rules.tier.null&fields%5Bpost%5D=change_visibility_at,comment_count,content,current_user_can_delete,current_user_can_view,current_user_has_liked,embed,image,is_paid,like_count,min_cents_pledged_to_view,post_file,published_at,patron_count,patreon_url,post_type,pledge_url,thumbnail_url,teaser_text,title,upgrade_url,url,was_posted_by_campaign_owner&fields%5Buser%5D=image_url,full_name,url&fields%5Bcampaign%5D=avatar_photo_url,earnings_visibility,is_nsfw,is_monthly,name,url&fields%5Baccess_rule%5D=access_rule_type,amount_cents&sort=-published_at&filter%5Bis_draft%5D=false&filter%5Bcontains_exclusive_posts%5D=true&filter%5Bcampaign_id%5D=247331&json-api-use-default-includes=false&json-api-version=1.0 HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/user/141898 HTTP/1.1" 200 None
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): c10.patreonusercontent.com:443
[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "GET /3/e30%3D/patreon-media/p/post/28365302/9d7f9ba9f13f48d1b4709202bebe8d9f/1.jpg?token-time=1564704000&token-hash=DQMqNPtnn7BenunUTdHPPf6UlE30ajiHXiIn16FAM9g%3D HTTP/1.1" 200 1063004
./gallery-dl/patreon/2019_07_14_08_21_33_Cassandra_disguise_by_Vytz.jpg
[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "GET /3/e30%3D/patreon-media/p/post/28365274/1aae83f1a016451b913206d53ecf6f81/1.png?token-time=1564704000&token-hash=J4lq4S9Urlml5L9H3wWCfoIfbj1uTpj1Znahpbb9i6A%3D HTTP/1.1" 200 4866848
./gallery-dl/patreon/2019_07_14_08_18_47_Sonic_chain_unnoticed_prisoners.png
[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "GET /3/e30%3D/patreon-media/p/post/28218292/740e07f8bf474350a1e0926854e67753/1.jpg?token-time=1564704000&token-hash=0rkDVa2xEl2_U_pdcK_W90TGDIBUDY5_sPm20t977Ro%3D HTTP/1.1" 200 1884380
./gallery-dl/patreon/2019_07_08_11_33_28_Not_so_quiet_ambush_by_Vytz.jpg

Hm... everything works just fine on my machine.

Are you log in with username and password or session-id?

currently, you can only download your exclusives with your session-id.

mikf added a commit that referenced this issue Jul 19, 2019
Avoids Cloudflare CAPTCHAs on both Linux in Windows without
pyOpenSSL installed.
@mikf mikf added the bug label Jul 19, 2019
@mikf
Copy link
Owner

mikf commented Jul 19, 2019

The 403: Forbidden error comes from a Cloudflare CAPTCHA page. More infos here: #227 (comment).

This was technically already fixed in 56c7a66, and 84f4d3b makes it work even without pyOpenSSL installed. Get version 1.9.0, which was released an hour ago, and accessing Patreon should work (again).

@Aster-the-Med-Stu
Copy link
Contributor Author

Thanks, it works!

@harvimt
Copy link

harvimt commented Jan 22, 2020

This problem seems to be back...

> gallery-dl --version
1.12.3

Windows 10 64 bit, with pyopenssl and/or cryptography, upgraded all the dependencies to latest as well (requests etc.)

Logging into Patreon using a cookies.txt file

@mikf
Copy link
Owner

mikf commented Jan 22, 2020

What's your Python version? You need Python 3.7.4 or higher on Windows.

See #508 (comment)

@harvimt
Copy link

harvimt commented Jan 23, 2020 via email

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