Similar questions:
- https://forums.plex.tv/t/using-an-http-proxy-for-fetching-metadata/162215/10
- https://forums.plex.tv/t/any-hope-for-plex-to-actually-work-with-a-web-proxy/6752
- https://forums.plex.tv/t/is-there-way-to-specify-a-proxy-for-media-server/23050
- https://forums.plex.tv/t/more-automatic-proxy-configuration/521/7
This post helps you set up plex to access scraper API (thetvdb for example) via your proxy on macOS. Plex doesn't respect the system-level sock proxy (in Network settings), but it respects the HTTP_PROXY and HTTPS_PROXY variables.
Because we're going to set up the system-level HTTP_PROXY variable below. It's better to configure your proxy to only the desired domains, so it won't affect other apps.
Test your proxy app.
HTTPS_PROXY=https://127.0.0.1:7070 curl -I https://thetvdb.com
...
HTTP/2 200
http://127.0.0.1:7070 is the example proxy address.
Set once for testing:
launchctl setenv HTTP_PROXY http://127.0.0.1:7070
launchctl setenv HTTPS_PROXY http://127.0.0.1:7070
To make it presistent, create an my.environments.plist file in ~/Library/LaunchAgents/ with this content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.environments</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv HTTP_PROXY http://127.0.0.1:7070
launchctl setenv HTTPS_PROXY http://127.0.0.1:7070
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Load it the plist file
launchctl load ~/Library/LaunchAgents/my.environments.plist
Verify it
launchctl list | grep my.environments
- 0 my.environments
Open a new terminal app and print the env
env|grep HTTP
HTTP_PROXY http://127.0.0.1:7070
HTTPS_PROXY http://127.0.0.1:7070
Find a media file and remtach it with the desired scraper api. It should just work.
Double-check the Plex logs. Locate the log files: https://support.plex.tv/articles/200250417-plex-media-server-log-files/.
~/Library/Logs/Plex Media Server/PMS Plugin Logs/com.plexapp.agents.thetvdb.log
Open it and navigate to the end, you will see below.
... Requesting 'https://artworks.thetvdb.com/banners/.....jpg`
... Not caching .....
If anything goes incorrect you will see a timeout after the request.