Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage-1
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-1
Commits
4437624a
Commit
4437624a
authored
Jan 5, 2016
by
miigotu
Browse files
Options
Downloads
Patches
Plain Diff
Move try/catch in ettv, fix typo in torrentleech
parent
d8ba2baa
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sickbeard/providers/extratorrent.py
+18
-19
18 additions, 19 deletions
sickbeard/providers/extratorrent.py
sickbeard/providers/torrentleech.py
+1
-1
1 addition, 1 deletion
sickbeard/providers/torrentleech.py
with
19 additions
and
20 deletions
sickbeard/providers/extratorrent.py
+
18
−
19
View file @
4437624a
...
...
@@ -18,7 +18,6 @@
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
import
re
import
traceback
import
sickbeard
from
sickbeard
import
logger
from
sickbeard
import
tvcache
...
...
@@ -74,18 +73,21 @@ class ExtraTorrentProvider(TorrentProvider): # pylint: disable=too-many-instanc
with
BS4Parser
(
data
,
'
html5lib
'
)
as
parser
:
for
item
in
parser
.
findAll
(
'
item
'
):
try
:
title
=
re
.
sub
(
r
'
^<!\[CDATA\[|\]\]>$
'
,
''
,
item
.
find
(
'
title
'
).
get_text
(
strip
=
True
))
if
item
.
find
(
'
title
'
)
else
None
size
=
try_int
(
item
.
find
(
'
size
'
).
get_text
(
strip
=
True
),
-
1
)
if
item
.
find
(
'
size
'
)
else
-
1
seeders
=
try_int
(
item
.
find
(
'
seeders
'
).
get_text
(
strip
=
True
))
if
item
.
find
(
'
seeders
'
)
else
0
leechers
=
try_int
(
item
.
find
(
'
leechers
'
).
get_text
(
strip
=
True
))
if
item
.
find
(
'
leechers
'
)
else
0
title
=
re
.
sub
(
r
'
^<!\[CDATA\[|\]\]>$
'
,
''
,
item
.
find
(
'
title
'
).
get_text
(
strip
=
True
))
size
=
try_int
(
item
.
find
(
'
size
'
).
get_text
(
strip
=
True
),
-
1
)
seeders
=
try_int
(
item
.
find
(
'
seeders
'
).
get_text
(
strip
=
True
))
leechers
=
try_int
(
item
.
find
(
'
leechers
'
).
get_text
(
strip
=
True
))
if
sickbeard
.
TORRENT_METHOD
==
'
blackhole
'
:
enclosure
=
item
.
find
(
'
enclosure
'
)
# Backlog doesnt have enclosure
download_url
=
enclosure
[
'
url
'
]
if
enclosure
else
item
.
find
(
'
link
'
).
next
.
strip
()
download_url
=
re
.
sub
(
r
'
(.*)/torrent/(.*).html
'
,
r
'
\1/download/\2.torrent
'
,
download_url
)
else
:
info_hash
=
item
.
find
(
'
info_hash
'
).
get_text
(
strip
=
True
)
if
item
.
find
(
'
info_hash
'
)
else
None
download_url
=
"
magnet:?xt=urn:btih:
"
+
info_hash
+
"
&dn=
"
+
title
+
self
.
_custom_trackers
if
info_hash
and
title
else
None
info_hash
=
item
.
find
(
'
info_hash
'
).
get_text
(
strip
=
True
)
download_url
=
"
magnet:?xt=urn:btih:
"
+
info_hash
+
"
&dn=
"
+
title
+
self
.
_custom_trackers
except
(
AttributeError
,
TypeError
,
KeyError
,
ValueError
):
continue
if
not
all
([
title
,
download_url
]):
continue
...
...
@@ -102,9 +104,6 @@ class ExtraTorrentProvider(TorrentProvider): # pylint: disable=too-many-instanc
items
[
mode
].
append
(
item
)
except
(
AttributeError
,
TypeError
,
KeyError
,
ValueError
):
logger
.
log
(
u
"
Failed parsing provider. Traceback: %r
"
%
traceback
.
format_exc
(),
logger
.
WARNING
)
# For each search mode sort all the items by seeders if available
items
[
mode
].
sort
(
key
=
lambda
tup
:
tup
[
3
],
reverse
=
True
)
...
...
This diff is collapsed.
Click to expand it.
sickbeard/providers/torrentleech.py
+
1
−
1
View file @
4437624a
...
...
@@ -116,7 +116,7 @@ class TorrentLeechProvider(TorrentProvider):
seeders
=
try_int
(
result
.
find
(
'
td
'
,
class_
=
'
seeders
'
).
get_text
(
strip
=
True
))
leechers
=
try_int
(
result
.
find
(
'
td
'
,
class_
=
'
leechers
'
).
get_text
(
strip
=
True
))
size
=
self
.
_convertSize
(
result
.
find_all
(
'
td
'
)[
labels
.
index
of
(
'
Size
'
)].
get_text
(
strip
=
True
))
size
=
self
.
_convertSize
(
result
.
find_all
(
'
td
'
)[
labels
.
index
(
'
Size
'
)].
get_text
(
strip
=
True
))
except
(
AttributeError
,
TypeError
,
KeyError
,
ValueError
):
continue
...
...
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