mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
Merge branch 'main' into individual-game
This commit is contained in:
commit
18e147a173
2 changed files with 11 additions and 7 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import json
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import functools
|
||||
import threading
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
|
@ -67,14 +69,16 @@ class Library:
|
|||
|
||||
def download_library(self, platform=None):
|
||||
"""Download all games in the library"""
|
||||
|
||||
with ThreadPoolExecutor(max_workers=self.jobs) as executor:
|
||||
i = 0
|
||||
i = [0]
|
||||
l = len(self.games)
|
||||
lock = threading.RLock()
|
||||
|
||||
def dl(g):
|
||||
def dl(i, g):
|
||||
x = g.download(self.login, platform)
|
||||
print(f"Downloaded {i} games of {l}")
|
||||
with lock:
|
||||
i[0] += 1
|
||||
print(f"Downloaded {g.name} ({i[0]} of {l})")
|
||||
return x
|
||||
|
||||
executor.map(dl, self.games)
|
||||
executor.map(functools.partial(dl, i), self.games)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "itchiodl"
|
||||
version = "1.2.1"
|
||||
version = "2.0.0"
|
||||
description = "Python Scripts for downloading / archiving your itchio library"
|
||||
authors = ["Peter Taylor <me@et1.uk>"]
|
||||
license = "MIT"
|
||||
|
|
@ -22,4 +22,4 @@ build-backend = "poetry.core.masonry.api"
|
|||
|
||||
[tool.poetry.plugins."console_scripts"]
|
||||
"itch-download" = "itchiodl.downloader.__main__:main"
|
||||
"itch-load-bundle" = "itchiodl.bundle_tool.__main__:main"
|
||||
"itch-load-bundle" = "itchiodl.bundle_tool.__main__:main"
|
||||
|
|
|
|||
Loading…
Reference in a new issue