Skip to content

Commit

Permalink
TesT
Browse files Browse the repository at this point in the history
  • Loading branch information
abelfodil committed Dec 9, 2024
1 parent daaedaf commit c78dcdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Config:
def __init__(self):
self.raw_config = self._load_config()
self._write_config()
self._watch_config_changes()

def __getitem__(self, arg):
return self.raw_config[arg]
Expand Down
5 changes: 3 additions & 2 deletions wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ def _get_random_wallpaper():
"ratios": "16x9,16x10",
}

with urlopen(Request(api_url + urlencode(params), headers={"User-Agent": "randwall/1.0"})) as f:
response = f.read().decode("utf-8")

try:
with urlopen(Request(api_url + urlencode(params), headers={"User-Agent": "randwall/1.0"})) as f:
response = f.read().decode("utf-8")
data = json.loads(response)
image_data = data["data"][0]
return {
Expand Down

0 comments on commit c78dcdc

Please sign in to comment.