Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SiCKRAGE
sickrage
Commits
8e5e7aad
Commit
8e5e7aad
authored
May 06, 2022
by
echel0n
Browse files
Merge branch 'release/10.0.59'
parents
63dd97dd
53efac31
Changes
44
Hide whitespace changes
Inline
Side-by-side
sickrage/locale/zh_CN/LC_MESSAGES/messages.mo
View file @
8e5e7aad
No preview for this file type
sickrage/locale/zh_TW/LC_MESSAGES/messages.mo
View file @
8e5e7aad
No preview for this file type
sickrage/search_providers/torrent/rarbg.py
View file @
8e5e7aad
...
...
@@ -127,43 +127,57 @@ class RarbgProvider(TorrentProvider):
search_params
[
'search_string'
]
=
search_string
# Check if token is still valid before search
if
not
self
.
login
():
continue
# sleep 5 secs per request
sleep
(
5
)
resp
=
self
.
session
.
get
(
self
.
urls
[
'api'
],
params
=
search_params
,
random_ua
=
True
)
if
not
resp
or
not
resp
.
content
:
sickrage
.
app
.
log
.
debug
(
"No data returned from provider"
)
continue
try
:
data
=
resp
.
json
()
except
ValueError
:
sickrage
.
app
.
log
.
debug
(
"No data returned from provider"
)
continue
error
=
data
.
get
(
'error'
)
error_code
=
data
.
get
(
'error_code'
)
if
error
:
# List of errors: https://github.com/rarbg/torrentapi/issues/1#issuecomment-114763312
if
error_code
==
5
:
# 5 = Too many requests per second
log_level
=
sickrage
.
app
.
log
.
INFO
elif
error_code
not
in
(
4
,
8
,
10
,
12
,
14
,
20
):
# 4 = Invalid token. Use get_token for a new one!
# 8, 10, 12, 14 = Cant find * in database. Are you sure this * exists?
# 20 = No results found
log_level
=
sickrage
.
app
.
log
.
WARNING
else
:
log_level
=
sickrage
.
app
.
log
.
DEBUG
sickrage
.
app
.
log
.
log
(
log_level
,
'{msg} Code: {code}'
.
format
(
msg
=
error
,
code
=
error_code
))
continue
results
+=
self
.
parse
(
data
,
mode
)
max_retries
=
retries
=
5
while
retries
>
0
:
backoff
=
2
**
(
max_retries
-
retries
)
# Check if token is still valid before search
if
not
self
.
login
():
break
# sleep per request based on backoff variable
sleep
(
backoff
)
resp
=
self
.
session
.
get
(
self
.
urls
[
'api'
],
params
=
search_params
,
random_ua
=
True
)
if
not
resp
or
not
resp
.
content
:
sickrage
.
app
.
log
.
debug
(
"No data returned from provider"
)
break
try
:
data
=
resp
.
json
()
except
ValueError
:
sickrage
.
app
.
log
.
debug
(
"No data returned from provider"
)
break
error
=
data
.
get
(
'error'
)
error_code
=
data
.
get
(
'error_code'
)
if
error
:
# List of errors: https://github.com/rarbg/torrentapi/issues/1#issuecomment-114763312
if
error_code
==
5
:
# 5 = Too many requests per second
log_level
=
sickrage
.
app
.
log
.
INFO
retries
-=
1
elif
error_code
not
in
(
8
,
10
,
12
,
14
,
20
):
# 8, 10, 12, 14 = Cant find * in database. Are you sure this * exists?
# 20 = No results found
log_level
=
sickrage
.
app
.
log
.
WARNING
retries
=
0
elif
error_code
not
in
(
2
,
4
):
# 2, 4 = Invalid token. Use get_token for a new one!
log_level
=
sickrage
.
app
.
log
.
WARNING
retries
-=
1
else
:
log_level
=
sickrage
.
app
.
log
.
DEBUG
retries
=
0
if
retries
:
continue
sickrage
.
app
.
log
.
log
(
log_level
,
'{msg} Code: {code}'
.
format
(
msg
=
error
,
code
=
error_code
))
break
results
+=
self
.
parse
(
data
,
mode
)
break
return
results
...
...
sickrage/version.txt
View file @
8e5e7aad
10.0.58
\ No newline at end of file
10.0.59
\ No newline at end of file
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment