From 06a3224eb877640127d37f9497a2f1f2379b035b Mon Sep 17 00:00:00 2001
From: Christopher <4Christopher@gmx.de>
Date: Mon, 11 Mar 2013 18:06:54 +0100
Subject: wrote crypter plugin for chip.de/videos
---
module/plugins/crypter/ChipDe.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 module/plugins/crypter/ChipDe.py
(limited to 'module/plugins/crypter')
diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py
new file mode 100644
index 000000000..955d731b2
--- /dev/null
+++ b/module/plugins/crypter/ChipDe.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Crypter import Crypter
+
+class ChipDe(Crypter):
+ __name__ = "ChipDe"
+ __type__ = "container"
+ __pattern__ = r"http://(?:www\.)?chip.de/video/.*\.html"
+ __version__ = "0.1"
+ __description__ = """Chip.de Container Plugin"""
+ __author_name__ = ('4Christopher')
+ __author_mail__ = ('4Christopher@gmx.de')
+
+ def decrypt(self, pyfile):
+ # self.package = pyfile.package()
+ self.html = self.load(pyfile.url)
+ try:
+ url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1)
+ self.logDebug('The file URL is %s' % url)
+ except:
+ self.fail('Failed to find the URL')
+
+ self.packages.append((self.pyfile.package().name, [ url ], self.pyfile.package().folder))
--
cgit v1.2.3
From 6c80f7bf4e9e1e21eeb0cc2522e6b674b793cd7a Mon Sep 17 00:00:00 2001
From: Christopher <4Christopher@gmx.de>
Date: Mon, 11 Mar 2013 20:48:41 +0100
Subject: added setting to set how many URLs should be returned for each
episode.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Usually the first URL will be all you need. The movie2k.to website also just
returns the first URL but in the source code of the website there are more
links for each episode …
---
module/plugins/crypter/ChipDe.py | 1 -
module/plugins/crypter/Movie2kTo.py | 56 ++++++++++++++++++++-----------------
2 files changed, 30 insertions(+), 27 deletions(-)
(limited to 'module/plugins/crypter')
diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py
index 955d731b2..fcb84a300 100644
--- a/module/plugins/crypter/ChipDe.py
+++ b/module/plugins/crypter/ChipDe.py
@@ -14,7 +14,6 @@ class ChipDe(Crypter):
__author_mail__ = ('4Christopher@gmx.de')
def decrypt(self, pyfile):
- # self.package = pyfile.package()
self.html = self.load(pyfile.url)
try:
url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1)
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py
index a9cdb188b..1b93dfa78 100644
--- a/module/plugins/crypter/Movie2kTo.py
+++ b/module/plugins/crypter/Movie2kTo.py
@@ -3,15 +3,17 @@
import re
from module.plugins.Crypter import Crypter
+from collections import defaultdict
class Movie2kTo(Crypter):
- __name__ = "Movie2kTo"
- __type__ = "container"
- __pattern__ = r"http://(?:www\.)?movie2k\.to/(.*)\.html"
- __version__ = "0.2"
- __config__ = [("accepted_hosters", "str", "List of accepted hosters", "Xvidstage, "),
- ("whole_season", "bool", "Download whole season", "False"),
- ("everything", "bool", "Download everything", "False")]
+ __name__ = 'Movie2kTo'
+ __type__ = 'container'
+ __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html'
+ __version__ = '0.3'
+ __config__ = [('accepted_hosters', 'str', 'List of accepted hosters', 'Xvidstage, '),
+ ('whole_season', 'bool', 'Download whole season', 'False'),
+ ('everything', 'bool', 'Download everything', 'False'),
+ ('firstN', 'int', 'Download the first N files for each episode. The first file is probably all you will need.', '1')]
__description__ = """Movie2k.to Container Plugin"""
__author_name__ = ('4Christopher')
__author_mail__ = ('4Christopher@gmx.de')
@@ -21,7 +23,7 @@ class Movie2kTo(Crypter):
SEASON_PATTERN = r'
(.*?)
'
EP_PATTERN = r''
BASE_URL = 'http://www.movie2k.to'
-
+
def decrypt(self, pyfile):
self.package = pyfile.package()
self.folder = self.package.folder
@@ -42,17 +44,18 @@ class Movie2kTo(Crypter):
season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path))
elif (whole_season and (season_sel == 'inline')) or everything:
season_links += self.getInfoAndLinks('%s/%s' % (self.BASE_URL, url_path))
- self.packages.append(('%s: Season %s' % (self.name, season), season_links, 'Season %s' % season))
+ self.logDebug(season_links)
+ self.packages.append(('%s: Season %s' % (self.name, season), season_links, 'Season %s' % season))
else:
self.packages.append((self.package.name, self.getLinks(), self.package.folder))
-
+
def tvshow_number(self, number):
if int(number) < 10:
return '0%s' % number
else:
return number
-
+
def name_tvshow(self, season, ep):
return '%s S%sE%s' % (self.name, self.tvshow_number(season), self.tvshow_number(ep))
@@ -77,8 +80,10 @@ class Movie2kTo(Crypter):
self.getInfo(url)
return self.getLinks()
+ ## This function returns the links for one episode as list
def getLinks(self):
accepted_hosters = re.findall(r'\b(\w+?)\b', self.getConfig('accepted_hosters'))
+ firstN = self.getConfig('firstN')
links = []
## h_id: hoster_id of a possible hoster
re_hoster_id_js = re.compile(r'links\[(\d+?)\].+ (.+?)')
@@ -88,22 +93,21 @@ class Movie2kTo(Crypter):
re_hoster_id = re_hoster_id_js
elif re_hoster_id_html.search(self.html):
re_hoster_id = re_hoster_id_html
+ count = 0
for h_id, hoster in re_hoster_id.findall(self.html):
if hoster in accepted_hosters:
- if h_id != self.id:
- self.html = self.load('%s/tvshows-%s-%s.html' % (self.BASE_URL, h_id, self.name))
- else:
- self.logDebug('This is already the right ID')
- try:
- url = re.search(r'
Date: Mon, 11 Mar 2013 21:12:25 +0100
Subject: made the firstN setting ready for more than one hoster
---
module/plugins/crypter/Movie2kTo.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'module/plugins/crypter')
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py
index 1b93dfa78..d1c711f17 100644
--- a/module/plugins/crypter/Movie2kTo.py
+++ b/module/plugins/crypter/Movie2kTo.py
@@ -93,11 +93,11 @@ class Movie2kTo(Crypter):
re_hoster_id = re_hoster_id_js
elif re_hoster_id_html.search(self.html):
re_hoster_id = re_hoster_id_html
- count = 0
+ count = defaultdict(int)
for h_id, hoster in re_hoster_id.findall(self.html):
if hoster in accepted_hosters:
- count += 1
- if count <= firstN:
+ count[hoster] += 1
+ if count[hoster] <= firstN:
if h_id != self.id:
self.html = self.load('%s/tvshows-%s-%s.html' % (self.BASE_URL, h_id, self.name))
else:
--
cgit v1.2.3
From 728e322eea109d4245199179d9dfbeb98966dba2 Mon Sep 17 00:00:00 2001
From: Christopher <4Christopher@gmx.de>
Date: Tue, 12 Mar 2013 11:18:57 +0100
Subject: Movie2kTo: fixed regex to be more reliable
---
module/plugins/crypter/Movie2kTo.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'module/plugins/crypter')
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py
index d1c711f17..c32f6f930 100644
--- a/module/plugins/crypter/Movie2kTo.py
+++ b/module/plugins/crypter/Movie2kTo.py
@@ -87,15 +87,19 @@ class Movie2kTo(Crypter):
links = []
## h_id: hoster_id of a possible hoster
re_hoster_id_js = re.compile(r'links\[(\d+?)\].+ (.+?)')
- re_hoster_id_html = re.compile(r'')
+ re_hoster_id_html = re.compile(r'')
## I assume that the ID is 7 digits longs
if re_hoster_id_js.search(self.html):
re_hoster_id = re_hoster_id_js
+ self.logDebug('Assuming that the ID can be found in a JavaScript section.')
elif re_hoster_id_html.search(self.html):
re_hoster_id = re_hoster_id_html
+ self.logDebug('Assuming that the ID can be found in a HTML section.')
count = defaultdict(int)
for h_id, hoster in re_hoster_id.findall(self.html):
+ # self.logDebug('Hoster %s' % hoster)
if hoster in accepted_hosters:
+ # self.logDebug('Accepted %s' % hoster)
count[hoster] += 1
if count[hoster] <= firstN:
if h_id != self.id:
--
cgit v1.2.3