quasarr 2.4.8__py3-none-any.whl → 2.4.10__py3-none-any.whl
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.
Potentially problematic release.
This version of quasarr might be problematic. Click here for more details.
- quasarr/__init__.py +134 -70
- quasarr/api/__init__.py +40 -31
- quasarr/api/arr/__init__.py +116 -108
- quasarr/api/captcha/__init__.py +262 -137
- quasarr/api/config/__init__.py +76 -46
- quasarr/api/packages/__init__.py +138 -102
- quasarr/api/sponsors_helper/__init__.py +29 -16
- quasarr/api/statistics/__init__.py +19 -19
- quasarr/downloads/__init__.py +165 -72
- quasarr/downloads/linkcrypters/al.py +35 -18
- quasarr/downloads/linkcrypters/filecrypt.py +107 -52
- quasarr/downloads/linkcrypters/hide.py +5 -6
- quasarr/downloads/packages/__init__.py +342 -177
- quasarr/downloads/sources/al.py +191 -100
- quasarr/downloads/sources/by.py +31 -13
- quasarr/downloads/sources/dd.py +27 -14
- quasarr/downloads/sources/dj.py +1 -3
- quasarr/downloads/sources/dl.py +126 -71
- quasarr/downloads/sources/dt.py +11 -5
- quasarr/downloads/sources/dw.py +28 -14
- quasarr/downloads/sources/he.py +32 -24
- quasarr/downloads/sources/mb.py +19 -9
- quasarr/downloads/sources/nk.py +14 -10
- quasarr/downloads/sources/nx.py +8 -18
- quasarr/downloads/sources/sf.py +45 -20
- quasarr/downloads/sources/sj.py +1 -3
- quasarr/downloads/sources/sl.py +9 -5
- quasarr/downloads/sources/wd.py +32 -12
- quasarr/downloads/sources/wx.py +35 -21
- quasarr/providers/auth.py +42 -37
- quasarr/providers/cloudflare.py +28 -30
- quasarr/providers/hostname_issues.py +2 -1
- quasarr/providers/html_images.py +2 -2
- quasarr/providers/html_templates.py +22 -14
- quasarr/providers/imdb_metadata.py +149 -80
- quasarr/providers/jd_cache.py +131 -39
- quasarr/providers/log.py +1 -1
- quasarr/providers/myjd_api.py +260 -196
- quasarr/providers/notifications.py +53 -41
- quasarr/providers/obfuscated.py +9 -4
- quasarr/providers/sessions/al.py +71 -55
- quasarr/providers/sessions/dd.py +21 -14
- quasarr/providers/sessions/dl.py +30 -19
- quasarr/providers/sessions/nx.py +23 -14
- quasarr/providers/shared_state.py +292 -141
- quasarr/providers/statistics.py +75 -43
- quasarr/providers/utils.py +33 -27
- quasarr/providers/version.py +45 -14
- quasarr/providers/web_server.py +10 -5
- quasarr/search/__init__.py +30 -18
- quasarr/search/sources/al.py +124 -73
- quasarr/search/sources/by.py +110 -59
- quasarr/search/sources/dd.py +57 -35
- quasarr/search/sources/dj.py +69 -48
- quasarr/search/sources/dl.py +159 -100
- quasarr/search/sources/dt.py +110 -74
- quasarr/search/sources/dw.py +121 -61
- quasarr/search/sources/fx.py +108 -62
- quasarr/search/sources/he.py +78 -49
- quasarr/search/sources/mb.py +96 -48
- quasarr/search/sources/nk.py +80 -50
- quasarr/search/sources/nx.py +91 -62
- quasarr/search/sources/sf.py +171 -106
- quasarr/search/sources/sj.py +69 -48
- quasarr/search/sources/sl.py +115 -71
- quasarr/search/sources/wd.py +67 -44
- quasarr/search/sources/wx.py +188 -123
- quasarr/storage/config.py +65 -52
- quasarr/storage/setup.py +238 -140
- quasarr/storage/sqlite_database.py +10 -4
- {quasarr-2.4.8.dist-info → quasarr-2.4.10.dist-info}/METADATA +4 -3
- quasarr-2.4.10.dist-info/RECORD +81 -0
- quasarr-2.4.8.dist-info/RECORD +0 -81
- {quasarr-2.4.8.dist-info → quasarr-2.4.10.dist-info}/WHEEL +0 -0
- {quasarr-2.4.8.dist-info → quasarr-2.4.10.dist-info}/entry_points.txt +0 -0
- {quasarr-2.4.8.dist-info → quasarr-2.4.10.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,19 +7,20 @@ import os
|
|
|
7
7
|
|
|
8
8
|
import requests
|
|
9
9
|
|
|
10
|
-
from quasarr.providers.imdb_metadata import get_imdb_id_from_title
|
|
11
|
-
from quasarr.providers.imdb_metadata import get_poster_link
|
|
10
|
+
from quasarr.providers.imdb_metadata import get_imdb_id_from_title, get_poster_link
|
|
12
11
|
from quasarr.providers.log import info
|
|
13
12
|
|
|
14
13
|
# Discord message flag for suppressing notifications
|
|
15
14
|
SUPPRESS_NOTIFICATIONS = 1 << 12 # 4096
|
|
16
15
|
|
|
17
16
|
silent = False
|
|
18
|
-
if os.getenv(
|
|
17
|
+
if os.getenv("SILENT"):
|
|
19
18
|
silent = True
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
def send_discord_message(
|
|
21
|
+
def send_discord_message(
|
|
22
|
+
shared_state, title, case, imdb_id=None, details=None, source=None
|
|
23
|
+
):
|
|
23
24
|
"""
|
|
24
25
|
Sends a Discord message to the webhook provided in the shared state, based on the specified case.
|
|
25
26
|
|
|
@@ -36,48 +37,50 @@ def send_discord_message(shared_state, title, case, imdb_id=None, details=None,
|
|
|
36
37
|
|
|
37
38
|
poster_object = None
|
|
38
39
|
if case == "unprotected" or case == "captcha":
|
|
39
|
-
if
|
|
40
|
+
if (
|
|
41
|
+
not imdb_id and " " not in title
|
|
42
|
+
): # this should prevent imdb_search for ebooks and magazines
|
|
40
43
|
imdb_id = get_imdb_id_from_title(shared_state, title)
|
|
41
44
|
if imdb_id:
|
|
42
45
|
poster_link = get_poster_link(shared_state, imdb_id)
|
|
43
46
|
if poster_link:
|
|
44
|
-
poster_object = {
|
|
45
|
-
'url': poster_link
|
|
46
|
-
}
|
|
47
|
+
poster_object = {"url": poster_link}
|
|
47
48
|
|
|
48
49
|
# Decide the embed content based on the case
|
|
49
50
|
if case == "unprotected":
|
|
50
|
-
description =
|
|
51
|
+
description = "No CAPTCHA required. Links were added directly!"
|
|
51
52
|
fields = None
|
|
52
53
|
elif case == "solved":
|
|
53
|
-
description =
|
|
54
|
+
description = "CAPTCHA solved by SponsorsHelper!"
|
|
54
55
|
fields = None
|
|
55
56
|
elif case == "failed":
|
|
56
|
-
description =
|
|
57
|
+
description = "SponsorsHelper failed to solve the CAPTCHA! Package marked as failed for deletion."
|
|
57
58
|
fields = None
|
|
58
59
|
elif case == "disabled":
|
|
59
|
-
description =
|
|
60
|
+
description = "SponsorsHelper failed to solve the CAPTCHA! Please solve it manually to proceed."
|
|
60
61
|
fields = None
|
|
61
62
|
elif case == "captcha":
|
|
62
|
-
description =
|
|
63
|
+
description = "Download will proceed, once the CAPTCHA has been solved."
|
|
63
64
|
fields = [
|
|
64
65
|
{
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
"name": "Solve CAPTCHA",
|
|
67
|
+
"value": f"Open [this link]({f'{shared_state.values["external_address"]}/captcha'}) to solve the CAPTCHA.",
|
|
67
68
|
}
|
|
68
69
|
]
|
|
69
70
|
if not shared_state.values.get("helper_active"):
|
|
70
|
-
fields.append(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
fields.append(
|
|
72
|
+
{
|
|
73
|
+
"name": "SponsorsHelper",
|
|
74
|
+
"value": f"[Sponsors get automated CAPTCHA solutions!](https://github.com/rix1337/Quasarr?tab=readme-ov-file#sponsorshelper)",
|
|
75
|
+
}
|
|
76
|
+
)
|
|
74
77
|
elif case == "quasarr_update":
|
|
75
|
-
description = f
|
|
78
|
+
description = f"Please update to {details['version']} as soon as possible!"
|
|
76
79
|
if details:
|
|
77
80
|
fields = [
|
|
78
81
|
{
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
"name": "Release notes at: ",
|
|
83
|
+
"value": f"[GitHub.com: rix1337/Quasarr/{details['version']}]({details['link']})",
|
|
81
84
|
}
|
|
82
85
|
]
|
|
83
86
|
else:
|
|
@@ -87,41 +90,50 @@ def send_discord_message(shared_state, title, case, imdb_id=None, details=None,
|
|
|
87
90
|
return False
|
|
88
91
|
|
|
89
92
|
data = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
"username": "Quasarr",
|
|
94
|
+
"avatar_url": "https://raw.githubusercontent.com/rix1337/Quasarr/main/Quasarr.png",
|
|
95
|
+
"embeds": [
|
|
96
|
+
{
|
|
97
|
+
"title": title,
|
|
98
|
+
"description": description,
|
|
99
|
+
}
|
|
100
|
+
],
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
if source and source.startswith("http"):
|
|
99
104
|
if not fields:
|
|
100
105
|
fields = []
|
|
101
|
-
fields.append(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
fields.append(
|
|
107
|
+
{
|
|
108
|
+
"name": "Source",
|
|
109
|
+
"value": f"[View release details here]({source})",
|
|
110
|
+
}
|
|
111
|
+
)
|
|
105
112
|
|
|
106
113
|
if fields:
|
|
107
|
-
data[
|
|
114
|
+
data["embeds"][0]["fields"] = fields
|
|
108
115
|
|
|
109
116
|
if poster_object:
|
|
110
|
-
data[
|
|
111
|
-
data[
|
|
117
|
+
data["embeds"][0]["thumbnail"] = poster_object
|
|
118
|
+
data["embeds"][0]["image"] = poster_object
|
|
112
119
|
elif case == "quasarr_update":
|
|
113
|
-
data[
|
|
114
|
-
|
|
120
|
+
data["embeds"][0]["thumbnail"] = {
|
|
121
|
+
"url": "https://raw.githubusercontent.com/rix1337/Quasarr/main/Quasarr.png"
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
# Apply silent mode: suppress notifications for all cases except 'deleted'
|
|
118
125
|
if silent and case not in ["failed", "quasarr_update", "disabled"]:
|
|
119
|
-
data[
|
|
126
|
+
data["flags"] = SUPPRESS_NOTIFICATIONS
|
|
120
127
|
|
|
121
|
-
response = requests.post(
|
|
122
|
-
|
|
128
|
+
response = requests.post(
|
|
129
|
+
shared_state.values["discord"],
|
|
130
|
+
data=json.dumps(data),
|
|
131
|
+
headers={"Content-Type": "application/json"},
|
|
132
|
+
)
|
|
123
133
|
if response.status_code != 204:
|
|
124
|
-
info(
|
|
134
|
+
info(
|
|
135
|
+
f"Failed to send message to Discord webhook. Status code: {response.status_code}"
|
|
136
|
+
)
|
|
125
137
|
return False
|
|
126
138
|
|
|
127
139
|
return True
|