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
0540205c
Commit
0540205c
authored
9 years ago
by
labrys
Browse files
Options
Downloads
Patches
Plain Diff
Fix file size conversion for hdspace
parent
dec8d742
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/hdspace.py
+3
-14
3 additions, 14 deletions
sickbeard/providers/hdspace.py
with
3 additions
and
14 deletions
sickbeard/providers/hdspace.py
+
3
−
14
View file @
0540205c
...
@@ -26,6 +26,7 @@ from bs4 import BeautifulSoup
...
@@ -26,6 +26,7 @@ from bs4 import BeautifulSoup
from
sickbeard
import
logger
from
sickbeard
import
logger
from
sickbeard
import
tvcache
from
sickbeard
import
tvcache
from
sickrage.helper.common
import
convert_size
from
sickrage.providers.torrent.TorrentProvider
import
TorrentProvider
from
sickrage.providers.torrent.TorrentProvider
import
TorrentProvider
...
@@ -138,7 +139,8 @@ class HDSpaceProvider(TorrentProvider):
...
@@ -138,7 +139,8 @@ class HDSpaceProvider(TorrentProvider):
download_url
=
self
.
urls
[
'
base_url
'
]
+
dl_href
download_url
=
self
.
urls
[
'
base_url
'
]
+
dl_href
seeders
=
int
(
result
.
find
(
'
span
'
,
attrs
=
{
'
class
'
:
'
seedy
'
}).
find
(
'
a
'
).
text
)
seeders
=
int
(
result
.
find
(
'
span
'
,
attrs
=
{
'
class
'
:
'
seedy
'
}).
find
(
'
a
'
).
text
)
leechers
=
int
(
result
.
find
(
'
span
'
,
attrs
=
{
'
class
'
:
'
leechy
'
}).
find
(
'
a
'
).
text
)
leechers
=
int
(
result
.
find
(
'
span
'
,
attrs
=
{
'
class
'
:
'
leechy
'
}).
find
(
'
a
'
).
text
)
size
=
re
.
match
(
r
'
.*?([0-9]+,?\.?[0-9]* [KkMmGg]+[Bb]+).*
'
,
str
(
result
),
re
.
DOTALL
).
group
(
1
)
torrent_size
=
re
.
match
(
r
'
.*?([0-9]+,?\.?[0-9]* [KkMmGg]+[Bb]+).*
'
,
str
(
result
),
re
.
DOTALL
).
group
(
1
)
size
=
convert_size
(
torrent_size
)
or
-
1
if
not
all
([
title
,
download_url
]):
if
not
all
([
title
,
download_url
]):
continue
continue
...
@@ -168,19 +170,6 @@ class HDSpaceProvider(TorrentProvider):
...
@@ -168,19 +170,6 @@ class HDSpaceProvider(TorrentProvider):
def
seed_ratio
(
self
):
def
seed_ratio
(
self
):
return
self
.
ratio
return
self
.
ratio
def
_convertSize
(
self
,
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
)
class
HDSpaceCache
(
tvcache
.
TVCache
):
class
HDSpaceCache
(
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