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
1f1249bc
Commit
1f1249bc
authored
Jan 7, 2016
by
labrys
Browse files
Options
Downloads
Patches
Plain Diff
Fix file size conversion for newpct
parent
d3f8db7d
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/newpct.py
+4
-15
4 additions, 15 deletions
sickbeard/providers/newpct.py
with
4 additions
and
15 deletions
sickbeard/providers/newpct.py
+
4
−
15
View file @
1f1249bc
...
...
@@ -27,6 +27,7 @@ from sickbeard import helpers
from
sickbeard
import
logger
from
sickbeard
import
tvcache
from
sickbeard.bs4_parser
import
BS4Parser
from
sickrage.helper.common
import
convert_size
from
sickrage.providers.torrent.TorrentProvider
import
TorrentProvider
...
...
@@ -113,17 +114,18 @@ class newpctProvider(TorrentProvider):
for
row
in
torrent_table
[:
-
1
]:
try
:
torrent_size
=
row
.
findAll
(
'
td
'
)[
2
]
torrent_row
=
row
.
findAll
(
'
a
'
)[
0
]
download_url
=
torrent_row
.
get
(
'
href
'
,
''
)
size
=
self
.
_convertSize
(
torrent_size
.
text
)
title
=
self
.
_processTitle
(
torrent_row
.
get
(
'
title
'
,
''
))
# Provider does not provide seeders/leechers
seeders
=
1
leechers
=
0
torrent_size
=
row
.
findAll
(
'
td
'
)[
2
].
text
size
=
convert_size
(
torrent_size
)
or
-
1
except
(
AttributeError
,
TypeError
):
continue
...
...
@@ -199,19 +201,6 @@ class newpctProvider(TorrentProvider):
return
False
@staticmethod
def
_convertSize
(
size
):
size
,
modifier
=
size
.
split
(
'
'
)
size
=
float
(
size
)
if
modifier
in
'
KB
'
:
size
*=
1024
**
1
elif
modifier
in
'
MB
'
:
size
*=
1024
**
2
elif
modifier
in
'
GB
'
:
size
*=
1024
**
3
elif
modifier
in
'
TB
'
:
size
*=
1024
**
4
return
long
(
size
)
@staticmethod
def
_processTitle
(
title
):
...
...
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