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
d3f8db7d
Commit
d3f8db7d
authored
Jan 7, 2016
by
labrys
Browse files
Options
Downloads
Patches
Plain Diff
Fix file size conversion for morethantv
parent
c148dc6c
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/morethantv.py
+3
-21
3 additions, 21 deletions
sickbeard/providers/morethantv.py
with
3 additions
and
21 deletions
sickbeard/providers/morethantv.py
+
3
−
21
View file @
d3f8db7d
...
@@ -28,6 +28,7 @@ import traceback
...
@@ -28,6 +28,7 @@ import traceback
from
sickbeard
import
logger
from
sickbeard
import
logger
from
sickbeard
import
tvcache
from
sickbeard
import
tvcache
from
sickbeard.bs4_parser
import
BS4Parser
from
sickbeard.bs4_parser
import
BS4Parser
from
sickrage.helper.common
import
convert_size
from
sickrage.helper.exceptions
import
AuthException
from
sickrage.helper.exceptions
import
AuthException
from
sickrage.providers.torrent.TorrentProvider
import
TorrentProvider
from
sickrage.providers.torrent.TorrentProvider
import
TorrentProvider
...
@@ -145,12 +146,10 @@ class MoreThanTVProvider(TorrentProvider):
...
@@ -145,12 +146,10 @@ class MoreThanTVProvider(TorrentProvider):
download_url
=
self
.
urls
[
'
download
'
]
%
torrent_id_long
download_url
=
self
.
urls
[
'
download
'
]
%
torrent_id_long
seeders
=
cells
[
6
].
contents
[
0
]
seeders
=
cells
[
6
].
contents
[
0
]
leechers
=
cells
[
7
].
contents
[
0
]
leechers
=
cells
[
7
].
contents
[
0
]
torrent_size
=
cells
[
4
].
text
.
strip
()
size
=
-
1
size
=
convert_size
(
torrent_size
)
or
-
1
if
re
.
match
(
r
'
\d+([,\.]\d+)?\s*[KkMmGgTt]?[Bb]
'
,
cells
[
4
].
contents
[
0
]):
size
=
self
.
_convertSize
(
cells
[
4
].
text
.
strip
())
except
(
AttributeError
,
TypeError
):
except
(
AttributeError
,
TypeError
):
continue
continue
...
@@ -183,23 +182,6 @@ class MoreThanTVProvider(TorrentProvider):
...
@@ -183,23 +182,6 @@ class MoreThanTVProvider(TorrentProvider):
def
seed_ratio
(
self
):
def
seed_ratio
(
self
):
return
self
.
ratio
return
self
.
ratio
def
_convertSize
(
self
,
sizeString
):
size
=
sizeString
[:
-
2
].
strip
()
modifier
=
sizeString
[
-
2
:].
upper
()
try
:
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
except
Exception
:
size
=
-
1
return
long
(
size
)
class
MoreThanTVCache
(
tvcache
.
TVCache
):
class
MoreThanTVCache
(
tvcache
.
TVCache
):
def
__init__
(
self
,
provider_obj
):
def
__init__
(
self
,
provider_obj
):
...
...
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