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
99945cdb
Commit
99945cdb
authored
Jan 7, 2016
by
labrys
Browse files
Options
Downloads
Patches
Plain Diff
Fix file size conversion for tvchaosuk
parent
84b24210
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/tvchaosuk.py
+3
-21
3 additions, 21 deletions
sickbeard/providers/tvchaosuk.py
with
3 additions
and
21 deletions
sickbeard/providers/tvchaosuk.py
+
3
−
21
View file @
99945cdb
...
@@ -23,6 +23,7 @@ from sickbeard import tvcache
...
@@ -23,6 +23,7 @@ from sickbeard import tvcache
from
sickbeard
import
show_name_helpers
from
sickbeard
import
show_name_helpers
from
sickbeard.helpers
import
sanitizeSceneName
from
sickbeard.helpers
import
sanitizeSceneName
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
...
@@ -180,10 +181,8 @@ class TVChaosUKProvider(TorrentProvider):
...
@@ -180,10 +181,8 @@ class TVChaosUKProvider(TorrentProvider):
# Strip year from the end or we can't parse it!
# Strip year from the end or we can't parse it!
title
=
re
.
sub
(
r
'
[\. ]?\(\d{4}\)
'
,
''
,
title
)
title
=
re
.
sub
(
r
'
[\. ]?\(\d{4}\)
'
,
''
,
title
)
torrent_size
=
cells
[
4
].
getText
().
strip
()
torrent_size
=
cells
[
4
].
getText
()
size
=
-
1
size
=
convert_size
(
torrent_size
)
or
-
1
if
re
.
match
(
r
"
\d+([,\.]\d+)?\s*[KkMmGgTt]?[Bb]
"
,
torrent_size
):
size
=
self
.
_convertSize
(
torrent_size
.
rstrip
())
item
=
title
,
download_url
,
size
,
seeders
,
leechers
item
=
title
,
download_url
,
size
,
seeders
,
leechers
if
mode
!=
'
RSS
'
:
if
mode
!=
'
RSS
'
:
logger
.
log
(
u
"
Found result: %s
"
%
title
,
logger
.
DEBUG
)
logger
.
log
(
u
"
Found result: %s
"
%
title
,
logger
.
DEBUG
)
...
@@ -203,23 +202,6 @@ class TVChaosUKProvider(TorrentProvider):
...
@@ -203,23 +202,6 @@ class TVChaosUKProvider(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
TVChaosUKCache
(
tvcache
.
TVCache
):
class
TVChaosUKCache
(
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