Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CouchPotatoServer
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
CouchPotatoServer
Commits
73c5b902
Commit
73c5b902
authored
Dec 25, 2012
by
Ruud
Browse files
Options
Downloads
Patches
Plain Diff
TorrentDay support. closes #1161
parent
fd53ba06
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
couchpotato/core/providers/torrent/torrentday/__init__.py
+32
-0
32 additions, 0 deletions
couchpotato/core/providers/torrent/torrentday/__init__.py
couchpotato/core/providers/torrent/torrentday/main.py
+83
-0
83 additions, 0 deletions
couchpotato/core/providers/torrent/torrentday/main.py
with
115 additions
and
0 deletions
couchpotato/core/providers/torrent/torrentday/__init__.py
0 → 100644
+
32
−
0
View file @
73c5b902
from
.main
import
TorrentDay
def
start
():
return
TorrentDay
()
config
=
[{
'
name
'
:
'
torrentday
'
,
'
groups
'
:
[
{
'
tab
'
:
'
searcher
'
,
'
subtab
'
:
'
torrent_providers
'
,
'
name
'
:
'
TorrentDay
'
,
'
description
'
:
'
See <a href=
"
http://www.td.af/
"
>TorrentDay</a>
'
,
'
options
'
:
[
{
'
name
'
:
'
enabled
'
,
'
type
'
:
'
enabler
'
,
'
default
'
:
False
,
},
{
'
name
'
:
'
username
'
,
'
default
'
:
''
,
},
{
'
name
'
:
'
password
'
,
'
default
'
:
''
,
'
type
'
:
'
password
'
,
},
],
},
],
}]
This diff is collapsed.
Click to expand it.
couchpotato/core/providers/torrent/torrentday/main.py
0 → 100644
+
83
−
0
View file @
73c5b902
from
bs4
import
BeautifulSoup
from
couchpotato.core.helpers.encoding
import
tryUrlencode
,
toUnicode
from
couchpotato.core.helpers.variable
import
tryInt
,
getTitle
from
couchpotato.core.logger
import
CPLog
from
couchpotato.core.providers.base
import
ResultList
from
couchpotato.core.providers.torrent.base
import
TorrentProvider
import
time
import
traceback
log
=
CPLog
(
__name__
)
class
TorrentDay
(
TorrentProvider
):
urls
=
{
'
test
'
:
'
http://www.td.af/
'
,
'
login
'
:
'
http://www.td.af/torrents/
'
,
'
detail
'
:
'
http://www.td.af/details.php?id=%s
'
,
'
search
'
:
'
http://www.td.af/V3/API/API.php
'
,
'
download
'
:
'
http://www.td.af/download.php/%s/%s
'
,
}
cat_ids
=
[
([
11
],
[
'
720p
'
,
'
1080p
'
]),
([
1
,
21
,
25
],
[
'
cam
'
,
'
ts
'
,
'
dvdrip
'
,
'
tc
'
,
'
r5
'
,
'
scr
'
,
'
brrip
'
]),
([
3
],
[
'
dvdr
'
]),
([
5
],
[
'
bd50
'
]),
]
http_time_between_calls
=
1
#seconds
def
search
(
self
,
movie
,
quality
):
if
self
.
isDisabled
()
or
(
not
self
.
login_opener
and
not
self
.
login
()):
return
[]
q
=
'"
%s %s
"'
%
(
getTitle
(
movie
[
'
library
'
]),
movie
[
'
library
'
][
'
year
'
])
results
=
ResultList
(
self
,
movie
,
quality
,
imdb_results
=
True
)
params
=
{
'
/browse.php?
'
:
None
,
'
cata
'
:
'
yes
'
,
'
jxt
'
:
8
,
'
jxw
'
:
'
b
'
,
'
search
'
:
q
,
}
data
=
self
.
getJsonData
(
self
.
urls
[
'
search
'
],
params
=
params
,
opener
=
self
.
login_opener
)
try
:
torrents
=
data
.
get
(
'
Fs
'
,
[])[
0
].
get
(
'
Cn
'
,
{}).
get
(
'
torrents
'
,
[])
except
:
return
[]
for
torrent
in
torrents
:
results
.
append
({
'
id
'
:
torrent
[
'
id
'
],
'
name
'
:
torrent
[
'
name
'
],
'
url
'
:
self
.
urls
[
'
download
'
]
%
(
torrent
[
'
id
'
],
torrent
[
'
fname
'
]),
'
detail_url
'
:
self
.
urls
[
'
detail
'
]
%
torrent
[
'
id
'
],
'
size
'
:
self
.
parseSize
(
torrent
.
get
(
'
size
'
)),
'
seeders
'
:
tryInt
(
torrent
.
get
(
'
seed
'
)),
'
leechers
'
:
tryInt
(
torrent
.
get
(
'
leech
'
)),
'
download
'
:
self
.
loginDownload
,
'
get_more_info
'
:
self
.
getMoreInfo
,
})
return
results
def
getLoginParams
(
self
):
return
tryUrlencode
({
'
username
'
:
self
.
conf
(
'
username
'
),
'
password
'
:
self
.
conf
(
'
password
'
),
'
submit
'
:
'
submit
'
,
})
def
getMoreInfo
(
self
,
item
):
full_description
=
self
.
getCache
(
'
sceneaccess.%s
'
%
item
[
'
id
'
],
item
[
'
detail_url
'
],
cache_timeout
=
25920000
)
html
=
BeautifulSoup
(
full_description
)
nfo_pre
=
html
.
find
(
'
div
'
,
attrs
=
{
'
id
'
:
'
details_table
'
})
description
=
toUnicode
(
nfo_pre
.
text
)
if
nfo_pre
else
''
item
[
'
description
'
]
=
description
return
item
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