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
b8d86dd9
Commit
b8d86dd9
authored
Oct 15, 2015
by
Dustyn Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Add size parsing for nextgen
Add freeleech option for nextgen
parent
8e09c99c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/providers/nextgen.py
+23
-15
23 additions, 15 deletions
sickbeard/providers/nextgen.py
with
23 additions
and
15 deletions
sickbeard/providers/nextgen.py
+
23
−
15
View file @
b8d86dd9
...
@@ -51,9 +51,6 @@ class NextGenProvider(generic.TorrentProvider):
...
@@ -51,9 +51,6 @@ class NextGenProvider(generic.TorrentProvider):
self
.
urls
=
{
'
base_url
'
:
'
https://nxgn.org/
'
,
self
.
urls
=
{
'
base_url
'
:
'
https://nxgn.org/
'
,
'
search
'
:
'
https://nxgn.org/browse.php?search=%s&cat=0&incldead=0&modes=%s
'
,
'
search
'
:
'
https://nxgn.org/browse.php?search=%s&cat=0&incldead=0&modes=%s
'
,
'
login_page
'
:
'
https://nxgn.org/login.php
'
,
'
login_page
'
:
'
https://nxgn.org/login.php
'
,
'
detail
'
:
'
https://nxgn.org/details.php?id=%s
'
,
'
download
'
:
'
https://nxgn.org/download.php?id=%s
'
,
'
takelogin
'
:
'
https://nxgn.org/takelogin.php?csrf=
'
,
}
}
self
.
url
=
self
.
urls
[
'
base_url
'
]
self
.
url
=
self
.
urls
[
'
base_url
'
]
...
@@ -66,6 +63,7 @@ class NextGenProvider(generic.TorrentProvider):
...
@@ -66,6 +63,7 @@ class NextGenProvider(generic.TorrentProvider):
self
.
minseed
=
0
self
.
minseed
=
0
self
.
minleech
=
0
self
.
minleech
=
0
self
.
freeleech
=
True
def
isEnabled
(
self
):
def
isEnabled
(
self
):
return
self
.
enabled
return
self
.
enabled
...
@@ -162,21 +160,18 @@ class NextGenProvider(generic.TorrentProvider):
...
@@ -162,21 +160,18 @@ class NextGenProvider(generic.TorrentProvider):
for
result
in
entries
:
for
result
in
entries
:
try
:
try
:
torrentName
=
\
title
=
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-udgivelse2-users
'
}).
a
[
'
title
'
]
((
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-udgivelse2-users
'
})).
find
(
'
a
'
))[
'
title
'
]
download_url
=
self
.
urls
[
'
base_url
'
]
+
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-download
'
}).
a
[
'
id
'
]
torrentId
=
(
seeders
=
int
(
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-seeders
'
}).
text
)
((
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-download
'
})).
find
(
'
a
'
))[
'
href
'
]).
replace
(
leechers
=
int
(
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-leechers
'
}).
text
)
'
download.php?id=
'
,
''
)
size
=
self
.
_convertSize
(
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-size
'
}).
text
)
title
=
str
(
torrentName
)
freeleech
=
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
browse-mode-F2L
'
})
is
not
None
download_url
=
(
self
.
urls
[
'
download
'
]
%
torrentId
).
encode
(
'
utf8
'
)
torrent_details_url
=
(
self
.
urls
[
'
detail
'
]
%
torrentId
).
encode
(
'
utf8
'
)
seeders
=
int
(
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-seeders
'
}).
a
.
text
)
leechers
=
int
(
result
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
torrent-leechers
'
}).
a
.
text
)
#FIXME
size
=
-
1
except
(
AttributeError
,
TypeError
):
except
(
AttributeError
,
TypeError
):
continue
continue
if
self
.
freeleech
and
not
freeleech
:
continue
if
not
all
([
title
,
download_url
]):
if
not
all
([
title
,
download_url
]):
continue
continue
...
@@ -206,6 +201,19 @@ class NextGenProvider(generic.TorrentProvider):
...
@@ -206,6 +201,19 @@ class NextGenProvider(generic.TorrentProvider):
return
results
return
results
def
_convertSize
(
self
,
size
):
size
,
modifier
=
size
[:
-
2
],
size
[
-
2
:]
size
=
float
(
size
)
if
modifier
in
'
KB
'
:
size
=
size
*
1024
elif
modifier
in
'
MB
'
:
size
=
size
*
1024
**
2
elif
modifier
in
'
GB
'
:
size
=
size
*
1024
**
3
elif
modifier
in
'
TB
'
:
size
=
size
*
1024
**
4
return
size
def
findPropers
(
self
,
search_date
=
datetime
.
datetime
.
today
()):
def
findPropers
(
self
,
search_date
=
datetime
.
datetime
.
today
()):
results
=
[]
results
=
[]
...
...
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