diff --git a/add_repo_check.py b/add_repo_check.py index a30a981..6e86b31 100644 --- a/add_repo_check.py +++ b/add_repo_check.py @@ -1,7 +1,10 @@ -import sys, json, time, urllib.request -BASE="http://192.168.50.1:30013"; USER="flan" +import os, sys, json, time, urllib.request +BASE = os.environ.get("JELLYFIN_URL") +USER = os.environ.get("JELLYFIN_USER") +if not BASE or not USER: + sys.exit("set JELLYFIN_URL and JELLYFIN_USER, e.g. JELLYFIN_URL=http://jellyfin.example:8096 JELLYFIN_USER=admin") MYURL="https://git.arch.fyi/flan/jellyfin-placard/raw/branch/main/manifest.json" -H='MediaBrowser Client="poster-pin", Device="code", DeviceId="poster-pin-code-8e1f", Version="1.0"' +H='MediaBrowser Client="poster-pin", Device="placard-tools", DeviceId="poster-pin-tools", Version="1.0"' def call(p,m="GET",d=None,h=None): r=urllib.request.Request(BASE+p,data=d,method=m,headers=h or {}) with urllib.request.urlopen(r,timeout=30) as x: diff --git a/install_official.py b/install_official.py index 74af826..1b0c267 100644 --- a/install_official.py +++ b/install_official.py @@ -1,9 +1,12 @@ -import sys, json, time, urllib.request, urllib.error +import os, sys, json, time, urllib.request, urllib.error from urllib.parse import quote -BASE="http://192.168.50.1:30013"; USER="flan" +BASE = os.environ.get("JELLYFIN_URL") +USER = os.environ.get("JELLYFIN_USER") +if not BASE or not USER: + sys.exit("set JELLYFIN_URL and JELLYFIN_USER, e.g. JELLYFIN_URL=http://jellyfin.example:8096 JELLYFIN_USER=admin") GUID="b6f8e2a4-1c3d-4e5f-9a7b-2d4c6e8f0a1b" MYURL="https://git.arch.fyi/flan/jellyfin-placard/raw/branch/main/manifest.json" -H='MediaBrowser Client="poster-pin", Device="code", DeviceId="poster-pin-code-8e1f", Version="1.0"' +H='MediaBrowser Client="poster-pin", Device="placard-tools", DeviceId="poster-pin-tools", Version="1.0"' def call(p,m="GET",d=None,h=None,t=30): r=urllib.request.Request(BASE+p,data=d,method=m,headers=h or {}) with urllib.request.urlopen(r,timeout=t) as x: