Skip to content

Commit

Permalink
chore: Update Python version to 3.11, improve timeout handling in Scr…
Browse files Browse the repository at this point in the history
…aper class
  • Loading branch information
techtanic committed Jul 3, 2024
1 parent d353b8a commit 030acc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
pip install pyinstaller -U
- name: Build GUI
run: pyinstaller -y -F -w -i "extra/DUCE-LOGO.ico" --clean --name "DUCE-GUI-windows" --add-data "base.py;." --add-data "colors.py;." --add-data "README.md;." --add-data "LICENSE;." "gui.py"
run: pyinstaller -y -F -c -i "extra/DUCE-LOGO.ico" --clean --name "DUCE-GUI-windows" --add-data "base.py;." --add-data "colors.py;." --add-data "README.md;." --add-data "LICENSE;." "gui.py"

- name: Build CLI
run: pyinstaller -y -F -c -i "extra/DUCE-LOGO.ico" --clean --name "DUCE-CLI-windows" --add-data "base.py;." --add-data "colors.py;." --add-data "README.md;." --add-data "LICENSE;." "cli.py"
Expand Down
14 changes: 6 additions & 8 deletions base.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,13 @@ def rd(self):
r = requests.get(
"https://www.real.discount/api-web/all-courses/?store=Udemy&page=1&per_page=500&orderby=date&free=1&editorschoices=0",
headers=headers,
timeout=8,
timeout=(10,30)
).json()
except requests.exceptions.ConnectTimeout:
r = requests.get(
"https://www.real.discount/api-web/all-courses/?store=Udemy&page=1&per_page=40&orderby=date&free=1&editorschoices=0",
headers=headers,
timeout=8,
).json()

except requests.exceptions.Timeout:
self.rd_error = "Timeout"
self.rd_length = -1
self.rd_done = True
return
big_all.extend(r["results"])

self.rd_length = len(big_all)
Expand Down

0 comments on commit 030acc7

Please sign in to comment.