Open hacksysteam opened 1 year ago
Adding a referer seems to do the trick:
curl 'https://www.nationalgeographic.co.uk/page-data/photo-of-day/page-data.json' -H 'referer: https://www.nationalgeographic.co.uk/photo-of-day'
I searched for:
$ sudo find / -iname NationalGeographicDownloader.py
usr/lib/python3/dist-packages/variety/plugins/builtin/downloaders/NationalGeographicDownloader.py
And then patched it with the header.
--- ./NationalGeographicDownloader.py 2024-01-07 00:01:32.902208565 +1300
+++ /usr/lib/python3/dist-packages/variety/plugins/builtin/downloaders/NationalGeographicDownloader.py 2024-01-07 00:02:25.590369407 +1300
@@ -51,7 +51,7 @@
return self.ROOT_URL
def fill_queue(self):
- queue = Util.fetch_json(DATA_URL)
+ queue = Util.fetch_json(DATA_URL,headers = {"referer": "https://www.nationalgeographic.co.uk/photo-of-day"})
images = queue["result"]["pageContext"]["node"]["data"]["content"]["images"]
return images
Started working afterwards
Version of Variety 0.8.9 - PPA - Ubuntu -Jammy
Describe the bug National Geographic Downloader is broken.
Context Every time and even on the latest version.
To Reproduce
tail -f /var/log/syslog
Attach Variety's log file
Desktop environment and version GNOME
OS name and version