ThijsRay / podimo

https://podimo.thijs.sh
European Union Public License 1.2
46 stars 15 forks source link

An error occurred: 403, message='Forbidden', url=URL('https://graphql.pdm-gateway.com/graphql') #13

Closed sjcjonker closed 1 year ago

sjcjonker commented 1 year ago

My podimo to RSS was blocked by CloudFlare, a simple change to the headers seem to have resolved it. Apologies no pull request:

--- podimo.py   2023-07-22 22:50:48.307367971 +0200
+++ podimo.py-2023-07-22        2023-07-22 08:10:08.212276998 +0200
@@ -262,9 +262,9 @@

 def generateHeaders(authorization, locale):
     headers = {
-        'user-agent': 'Podimo/2.46.0 build 553/iOS 16.5.1',
-        'user-os': 'ios',
-        'user-version': '2.46.0',
+        'user-os': 'android',
+        'user-agent': 'Podimo/2.26.9 build 461/Android 32',
+        'user-version': '2.26.9',
         'user-locale': locale,
         "user-unique-id": randomHexId(16)
     }

For those with new Android values I'm sure they will work as well.

ThijsRay commented 1 year ago

Thank you for opening this issue. I've tried to apply your change but unfortunately it doesn't seem to solve the problem for me. I probably need to change a few more things as well, because Cloudflare expects the __cf_bm cookie to be set.

inukiwi commented 1 year ago

Can confirm these changes work for me

Donstil commented 1 year ago

I have changed the header but it did not work for me, still got 403 Forbidden.

I now get “ bad operand type for unary -: 'str'“

Edit: Ah my bad, str was a typo. after Edit the forbidden is back.

thajesta commented 1 year ago

Changed the header, but still not working for me.

thajesta commented 1 year ago

Its working for me again with the following header. For me the change to 2.46.2 of the Android user-agent did the trick.

def generateHeaders(authorization, locale): headers = { 'user-agent': 'Podimo/2.46.0 build 553/iOS 16.5.1', 'user-os': 'ios', 'user-version': '2.46.0', 'user-os': 'android', 'user-agent': 'Podimo/2.46.2 build 461/Android 32', 'user-version': '2.26.9', 'user-locale': locale, "user-unique-id": randomHexId(16) }

Donstil commented 1 year ago

Its working for me again with the following header. For me the change to 2.46.2 of the Android user-agent did the trick.

def generateHeaders(authorization, locale): headers = { 'user-agent': 'Podimo/2.46.0 build 553/iOS 16.5.1', 'user-os': 'ios', 'user-version': '2.46.0', 'user-os': 'android', 'user-agent': 'Podimo/2.46.2 build 461/Android 32', 'user-version': '2.26.9', 'user-locale': locale, "user-unique-id": randomHexId(16) }

Noice, this fixed it for me also.

ThijsRay commented 1 year ago

I've merged your change into the main branch. Unfortunately, it only seems to work locally. Cloudflare blocks datacenter IPs so I need a workaround for that. Hosting it locally does seem to work though.