Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
SickRage
Commits
b9ec121d
Commit
b9ec121d
authored
Jun 11, 2015
by
Dustyn Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Fix torrage and zoink.ch, because torcache has a timer and returns html instead of a torrent
parent
ae56749c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/providers/generic.py
+6
-4
6 additions, 4 deletions
sickbeard/providers/generic.py
with
6 additions
and
4 deletions
sickbeard/providers/generic.py
+
6
−
4
View file @
b9ec121d
...
@@ -146,6 +146,7 @@ class GenericProvider:
...
@@ -146,6 +146,7 @@ class GenericProvider:
if
self
.
providerType
==
GenericProvider
.
TORRENT
:
if
self
.
providerType
==
GenericProvider
.
TORRENT
:
try
:
try
:
torrent_hash
=
re
.
findall
(
'
urn:btih:([\w]{32,40})
'
,
result
.
url
)[
0
].
upper
()
torrent_hash
=
re
.
findall
(
'
urn:btih:([\w]{32,40})
'
,
result
.
url
)[
0
].
upper
()
torrent_name
=
re
.
findall
(
'
dn=([^&]+)
'
,
result
.
url
)[
0
]
if
len
(
torrent_hash
)
==
32
:
if
len
(
torrent_hash
)
==
32
:
torrent_hash
=
b16encode
(
b32decode
(
torrent_hash
)).
upper
()
torrent_hash
=
b16encode
(
b32decode
(
torrent_hash
)).
upper
()
...
@@ -156,9 +157,8 @@ class GenericProvider:
...
@@ -156,9 +157,8 @@ class GenericProvider:
urls
=
[
urls
=
[
'
http://torcache.net/torrent/
'
+
torrent_hash
+
'
.torrent
'
,
'
http://torcache.net/torrent/
'
+
torrent_hash
+
'
.torrent
'
,
#zoink.ch misconfigured, torrage.com domain expired.
'
http://zoink.ch/torrent/
'
+
torrent_name
+
'
.torrent
'
,
#'http://zoink.ch/torrent/' + torrent_hash + '.torrent',
'
http://torrage.com/torrent/
'
+
torrent_hash
+
'
.torrent
'
,
#'http://torrage.com/torrent/' + torrent_hash.lower() + '.torrent',
]
]
except
:
except
:
urls
=
[
result
.
url
]
urls
=
[
result
.
url
]
...
@@ -184,6 +184,8 @@ class GenericProvider:
...
@@ -184,6 +184,8 @@ class GenericProvider:
if
self
.
_verify_download
(
filename
):
if
self
.
_verify_download
(
filename
):
return
True
return
True
else
:
helpers
.
_remove_file_failed
(
filename
)
logger
.
log
(
u
"
Failed to download result
"
,
logger
.
WARNING
)
logger
.
log
(
u
"
Failed to download result
"
,
logger
.
WARNING
)
return
False
return
False
...
@@ -208,7 +210,7 @@ class GenericProvider:
...
@@ -208,7 +210,7 @@ class GenericProvider:
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
log
(
u
"
Failed to validate torrent file:
"
+
ex
(
e
),
logger
.
DEBUG
)
logger
.
log
(
u
"
Failed to validate torrent file:
"
+
ex
(
e
),
logger
.
DEBUG
)
logger
.
log
(
u
"
Result is not a valid torrent file
"
,
logger
.
WARNIN
G
)
logger
.
log
(
u
"
Result is not a valid torrent file
"
,
logger
.
DEBU
G
)
return
False
return
False
return
True
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment