sedd 2.4.0__tar.gz → 2.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sedd-2.4.0/sedd.egg-info → sedd-2.4.2}/PKG-INFO +1 -1
- {sedd-2.4.0 → sedd-2.4.2}/sedd/main.py +15 -6
- {sedd-2.4.0 → sedd-2.4.2}/sedd/meta/notifications.py +4 -3
- {sedd-2.4.0 → sedd-2.4.2/sedd.egg-info}/PKG-INFO +1 -1
- {sedd-2.4.0 → sedd-2.4.2}/LICENSE +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/README-python.md +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/README.md +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/pyproject.toml +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/__init__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/__main__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/cli.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/config/__init__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/config/config.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/config/defaults.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/config/typings.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/data/__init__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/data/files_map.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/data/sites.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/driver.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/meta/__init__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/pipscript.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/ubo/__init__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/ubo/ubo.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/ubo/utils.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/utils.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/watcher/__init__.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/watcher/handler.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/watcher/observer.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/watcher/recovery.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd/watcher/state.py +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd.egg-info/SOURCES.txt +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd.egg-info/dependency_links.txt +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd.egg-info/entry_points.txt +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd.egg-info/requires.txt +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/sedd.egg-info/top_level.txt +0 -0
- {sedd-2.4.0 → sedd-2.4.2}/setup.cfg +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import traceback
|
|
1
2
|
from selenium.webdriver.common.by import By
|
|
2
3
|
from selenium.webdriver.firefox.webdriver import WebDriver
|
|
3
4
|
from selenium.common.exceptions import NoSuchElementException
|
|
@@ -391,7 +392,9 @@ def clear_part_files():
|
|
|
391
392
|
|
|
392
393
|
def normalize_meta(url: str):
|
|
393
394
|
if (url.startswith("meta.") and url != "meta.stackexchange.com"):
|
|
394
|
-
return url.replace("meta.", "")
|
|
395
|
+
return url.replace("meta.", "", 1)
|
|
396
|
+
elif (".meta." in url):
|
|
397
|
+
return url.replace(".meta.", "", 1)
|
|
395
398
|
return url
|
|
396
399
|
|
|
397
400
|
def try_recover_fucked_download(
|
|
@@ -399,7 +402,7 @@ def try_recover_fucked_download(
|
|
|
399
402
|
state: DownloadState
|
|
400
403
|
):
|
|
401
404
|
# TODO: This is a very naive approach. Can we get the information directly
|
|
402
|
-
#
|
|
405
|
+
# from the webdriver?
|
|
403
406
|
for path in state.pending:
|
|
404
407
|
# The path is in the form of the full site URL with the .zip
|
|
405
408
|
# The .part file is in the form `[first path component].[garbage].[rest]`
|
|
@@ -505,10 +508,16 @@ try:
|
|
|
505
508
|
break
|
|
506
509
|
else:
|
|
507
510
|
if args.wipe_part_files:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
511
|
+
try:
|
|
512
|
+
try_recover_fucked_download(
|
|
513
|
+
last_sizes,
|
|
514
|
+
state
|
|
515
|
+
)
|
|
516
|
+
except Exception as e:
|
|
517
|
+
logger.error(
|
|
518
|
+
"Failed to error recovery; will continue retrying"
|
|
519
|
+
)
|
|
520
|
+
logger.error("{}", traceback.format_exc())
|
|
512
521
|
sleep(1)
|
|
513
522
|
|
|
514
523
|
notifications.notify(
|
|
@@ -15,15 +15,16 @@ def native(message: str, _):
|
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
def ntfy(message: str, config):
|
|
18
|
-
requests.post(
|
|
18
|
+
r = requests.post(
|
|
19
19
|
config["url"],
|
|
20
20
|
headers={
|
|
21
21
|
"Authorization": f"Bearer {config['bearer']}",
|
|
22
22
|
"Title": "Sedd update"
|
|
23
23
|
},
|
|
24
24
|
data=message,
|
|
25
|
-
|
|
26
25
|
)
|
|
26
|
+
if r.status_code >= 400:
|
|
27
|
+
logger.error("Ntfy failure: {}", r.status_code)
|
|
27
28
|
|
|
28
29
|
notification_providers = {
|
|
29
30
|
"native": native,
|
|
@@ -36,7 +37,7 @@ def notify(message: str, config: SEDDConfig):
|
|
|
36
37
|
provider = config.get_notifications_provider()
|
|
37
38
|
|
|
38
39
|
if provider is None:
|
|
39
|
-
logger.info(message)
|
|
40
|
+
logger.info("Notification (CLI fallback): {}", message)
|
|
40
41
|
return
|
|
41
42
|
|
|
42
43
|
notification_providers[provider](message, config.notifications)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|