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
46c7e3fb
Commit
46c7e3fb
authored
12 years ago
by
Ruud
Browse files
Options
Downloads
Patches
Plain Diff
IPTorrent support. closes #1411
Thanks to @seedboy
parent
eed0382b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
couchpotato/core/providers/torrent/iptorrents/__init__.py
+40
-0
40 additions, 0 deletions
couchpotato/core/providers/torrent/iptorrents/__init__.py
couchpotato/core/providers/torrent/iptorrents/main.py
+84
-0
84 additions, 0 deletions
couchpotato/core/providers/torrent/iptorrents/main.py
with
124 additions
and
0 deletions
couchpotato/core/providers/torrent/iptorrents/__init__.py
0 → 100644
+
40
−
0
View file @
46c7e3fb
from
.main
import
IPTorrents
def
start
():
return
IPTorrents
()
config
=
[{
'
name
'
:
'
iptorrents
'
,
'
groups
'
:
[
{
'
tab
'
:
'
searcher
'
,
'
subtab
'
:
'
providers
'
,
'
list
'
:
'
torrent_providers
'
,
'
name
'
:
'
IPTorrents
'
,
'
description
'
:
'
See <a href=
"
http://www.iptorrents.com
"
>IPTorrents</a>
'
,
'
wizard
'
:
True
,
'
options
'
:
[
{
'
name
'
:
'
enabled
'
,
'
type
'
:
'
enabler
'
,
'
default
'
:
False
,
},
{
'
name
'
:
'
username
'
,
'
default
'
:
''
,
},
{
'
name
'
:
'
password
'
,
'
default
'
:
''
,
'
type
'
:
'
password
'
,
},
{
'
name
'
:
'
freeleech
'
,
'
default
'
:
0
,
'
type
'
:
'
bool
'
,
'
description
'
:
'
Only search for [FreeLeech] torrents.
'
,
},
],
},
],
}]
This diff is collapsed.
Click to expand it.
couchpotato/core/providers/torrent/iptorrents/main.py
0 → 100644
+
84
−
0
View file @
46c7e3fb
from
bs4
import
BeautifulSoup
from
couchpotato.core.helpers.encoding
import
tryUrlencode
from
couchpotato.core.helpers.variable
import
tryInt
from
couchpotato.core.logger
import
CPLog
from
couchpotato.core.providers.torrent.base
import
TorrentProvider
import
traceback
log
=
CPLog
(
__name__
)
class
IPTorrents
(
TorrentProvider
):
urls
=
{
'
test
'
:
'
http://www.iptorrents.com/
'
,
'
login
'
:
'
http://www.iptorrents.com/torrents/
'
,
'
detail
'
:
'
http://www.iptorrents.com/details.php?id=%s
'
,
'
search
'
:
'
http://www.iptorrents.com/torrents/?l%d=1%s&q=%s&qf=ti
'
,
'
download
'
:
'
http://www.iptorrents.com/download.php/%s/%s.torrent
'
,
}
cat_ids
=
[
([
48
],
[
'
720p
'
,
'
1080p
'
,
'
bd50
'
]),
([
72
],
[
'
cam
'
,
'
ts
'
,
'
tc
'
,
'
r5
'
,
'
scr
'
]),
([
7
],
[
'
dvdrip
'
,
'
brrip
'
]),
([
6
],
[
'
dvdr
'
]),
]
http_time_between_calls
=
1
#seconds
cat_backup_id
=
None
def
_searchOnTitle
(
self
,
title
,
movie
,
quality
,
results
):
freeleech
=
''
if
not
self
.
conf
(
'
freeleech
'
)
else
'
&free=on
'
url
=
self
.
urls
[
'
search
'
]
%
(
self
.
getCatId
(
quality
[
'
identifier
'
])[
0
],
freeleech
,
tryUrlencode
(
'
%s %s
'
%
(
title
.
replace
(
'
:
'
,
''
),
movie
[
'
library
'
][
'
year
'
])))
data
=
self
.
getHTMLData
(
url
,
opener
=
self
.
login_opener
)
if
data
:
html
=
BeautifulSoup
(
data
)
try
:
result_table
=
html
.
find
(
'
table
'
,
attrs
=
{
'
class
'
:
'
torrents
'
})
if
not
result_table
:
return
entries
=
result_table
.
find_all
(
'
tr
'
)
for
result
in
entries
[
1
:]:
torrent
=
result
.
find_all
(
'
td
'
)[
1
].
find
(
'
a
'
)
torrent_id
=
torrent
[
'
href
'
].
replace
(
'
/details.php?id=
'
,
''
)
torrent_name
=
torrent
.
string
torrent_download_url
=
self
.
urls
[
'
download
'
]
%
(
torrent_id
,
torrent_name
.
replace
(
'
'
,
'
.
'
))
torrent_details_url
=
self
.
urls
[
'
detail
'
]
%
(
torrent_id
)
torrent_size
=
self
.
parseSize
(
result
.
find_all
(
'
td
'
)[
5
].
string
)
torrent_seeders
=
tryInt
(
result
.
find
(
'
td
'
,
attrs
=
{
'
class
'
:
'
ac t_seeders
'
}).
string
)
torrent_leechers
=
tryInt
(
result
.
find
(
'
td
'
,
attrs
=
{
'
class
'
:
'
ac t_leechers
'
}).
string
)
results
.
append
({
'
id
'
:
torrent_id
,
'
name
'
:
torrent_name
,
'
url
'
:
torrent_download_url
,
'
detail_url
'
:
torrent_details_url
,
'
download
'
:
self
.
loginDownload
,
'
size
'
:
torrent_size
,
'
seeders
'
:
torrent_seeders
,
'
leechers
'
:
torrent_leechers
,
})
except
:
log
.
error
(
'
Failed to parsing %s: %s
'
,
(
self
.
getName
(),
traceback
.
format_exc
()))
def
loginSuccess
(
self
,
output
):
return
'
don
\'
t have an account
'
not
in
output
.
lower
()
def
getLoginParams
(
self
):
return
tryUrlencode
({
'
username
'
:
self
.
conf
(
'
username
'
),
'
password
'
:
self
.
conf
(
'
password
'
),
'
login
'
:
'
submit
'
,
})
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