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
bec735b2
Commit
bec735b2
authored
Dec 31, 2015
by
miigotu
Browse files
Options
Downloads
Patches
Plain Diff
Fix issues with ettv and improve error handling
parent
6e160cde
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/extratorrent.py
+25
-36
25 additions, 36 deletions
sickbeard/providers/extratorrent.py
with
25 additions
and
36 deletions
sickbeard/providers/extratorrent.py
+
25
−
36
View file @
bec735b2
...
@@ -59,11 +59,8 @@ class ExtraTorrentProvider(TorrentProvider):
...
@@ -59,11 +59,8 @@ class ExtraTorrentProvider(TorrentProvider):
if
mode
!=
'
RSS
'
:
if
mode
!=
'
RSS
'
:
logger
.
log
(
u
"
Search string: %s
"
%
search_string
,
logger
.
DEBUG
)
logger
.
log
(
u
"
Search string: %s
"
%
search_string
,
logger
.
DEBUG
)
try
:
self
.
search_params
.
update
({
'
type
'
:
(
'
search
'
,
'
rss
'
)[
mode
==
'
RSS
'
],
'
search
'
:
search_string
})
self
.
search_params
.
update
({
'
type
'
:
(
'
search
'
,
'
rss
'
)[
mode
==
'
RSS
'
],
'
search
'
:
search_string
})
url
=
self
.
urls
[
'
rss
'
]
if
not
self
.
custom_url
else
self
.
urls
[
'
rss
'
].
replace
(
self
.
urls
[
'
index
'
],
self
.
custom_url
)
url
=
self
.
urls
[
'
rss
'
]
if
not
self
.
custom_url
else
self
.
urls
[
'
rss
'
].
replace
(
self
.
urls
[
'
index
'
],
self
.
custom_url
)
data
=
self
.
get_url
(
url
,
params
=
self
.
search_params
)
data
=
self
.
get_url
(
url
,
params
=
self
.
search_params
)
if
not
data
:
if
not
data
:
logger
.
log
(
u
"
No data returned from provider
"
,
logger
.
DEBUG
)
logger
.
log
(
u
"
No data returned from provider
"
,
logger
.
DEBUG
)
...
@@ -75,13 +72,16 @@ class ExtraTorrentProvider(TorrentProvider):
...
@@ -75,13 +72,16 @@ class ExtraTorrentProvider(TorrentProvider):
with
BS4Parser
(
data
,
'
html5lib
'
)
as
parser
:
with
BS4Parser
(
data
,
'
html5lib
'
)
as
parser
:
for
item
in
parser
.
findAll
(
'
item
'
):
for
item
in
parser
.
findAll
(
'
item
'
):
title
=
re
.
sub
(
r
'
^<!\[CDATA\[|\]\]>$
'
,
''
,
item
.
find
(
'
title
'
).
text
)
try
:
# info_hash = item.get('info_hash', '')
title
=
re
.
sub
(
r
'
^<!\[CDATA\[|\]\]>$
'
,
''
,
item
.
find
(
'
title
'
).
get_text
(
strip
=
True
))
size
=
try_int
(
item
.
find
(
'
size
'
).
text
,
-
1
)
if
item
.
find
(
'
size
'
)
else
-
1
# info_hash = item.find('info_hash').
seeders
=
try_int
(
item
.
find
(
'
seeders
'
).
text
,
1
)
if
item
.
find
(
'
seeders
'
)
else
1
size
=
try_int
(
item
.
find
(
'
size
'
).
get_text
(
strip
=
True
),
-
1
)
if
item
.
find
(
'
size
'
)
else
-
1
leechers
=
try_int
(
item
.
find
(
'
leechers
'
).
text
)
if
item
.
find
(
'
leechers
'
)
else
0
seeders
=
try_int
(
item
.
find
(
'
seeders
'
).
get_text
(
strip
=
True
))
if
item
.
find
(
'
seeders
'
)
else
0
enclosure
=
item
.
find
(
'
enclosure
'
)
leechers
=
try_int
(
item
.
find
(
'
leechers
'
).
get_text
(
strip
=
True
))
if
item
.
find
(
'
leechers
'
)
else
0
download_url
=
enclosure
[
'
url
'
]
if
enclosure
else
self
.
_magnet_from_details
(
item
.
find
(
'
link
'
).
text
)
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
)
if
not
all
([
title
,
download_url
]):
if
not
all
([
title
,
download_url
]):
continue
continue
...
@@ -108,17 +108,6 @@ class ExtraTorrentProvider(TorrentProvider):
...
@@ -108,17 +108,6 @@ class ExtraTorrentProvider(TorrentProvider):
return
results
return
results
def
_magnet_from_details
(
self
,
link
):
details
=
self
.
get_url
(
link
)
if
not
details
:
return
''
match
=
re
.
search
(
r
'
href=
"
(magnet.*?)
"'
,
details
)
if
not
match
:
return
''
return
match
.
group
(
1
)
def
seed_ratio
(
self
):
def
seed_ratio
(
self
):
return
self
.
ratio
return
self
.
ratio
...
...
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