Skip to content

Fix for Sudden "403 Forbidden" Error (PodMe WAF blocking default User-Agent) #20

@robertseifert28-ship-it

Description

@robertseifert28-ship-it

Sorry guys. I never use Github, but wanted to contribute.

As of recently, running the harvest script suddenly results in a 403 Forbidden error directly from PodMe's Nginx server.

Error output:
PodMeApiError: (403, {'message': '<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'})

Root Cause

PodMe has updated their Web Application Firewall (WAF) and is now actively blocking the hardcoded User-Agent used by podme-api.
Currently, the API tries to connect using:
Podme android app/6.29.3 (Linux;Android 15) AndroidXMedia3/1.5.1

When the server sees this specific User-Agent, it instantly drops the connection.

The Workaround / Fix

To bypass the WAF, the PODME_API_USER_AGENT needs to be spoofed to a standard desktop browser.

Manual fix:

  1. Navigate to your virtual environment and open site-packages/podme_api/const.py.
  2. Locate PODME_API_USER_AGENT.
  3. Replace the string with a standard browser agent, for example:
    PODME_API_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
  4. Save the file and run the script again. The downloads will start working immediately.

Automated fix for Windows/PowerShell users:
If you just want to patch your local environment quickly, you can run this in your PowerShell (make sure to update the path to match your actual environment):

$const_path = "C:\Path\To\Your\Env\venv\Lib\site-packages\podme_api\const.py"
(Get-Content $const_path) -replace '^PODME_API_USER_AGENT.*', "PODME_API_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36'" | Set-Content $const_path -Encoding UTF8


I'm not a programmer, so Ai did this for me, but it worked! 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions