diff options
author | Stefano <l.stickell@yahoo.it> | 2014-03-20 17:14:07 +0100 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-04-21 17:07:58 +0200 |
commit | e99a69928308633e26b847c0633e248b0405aa6f (patch) | |
tree | 6476dad1815888967fcb80d483ffac30719ed32f | |
parent | Merge pull request #552 from flubshi/stable (diff) | |
download | pyload-e99a69928308633e26b847c0633e248b0405aa6f.tar.xz |
Removed ARD from the repository
(cherry picked from commit c7b8e5b668dafe6fa1eb474b35cf313361482eac)
Conflicts:
pyload/plugins/hoster/ARD.py
-rw-r--r-- | pyload/plugins/hoster/ARD.py | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/pyload/plugins/hoster/ARD.py b/pyload/plugins/hoster/ARD.py deleted file mode 100644 index 12cb6c95a..000000000 --- a/pyload/plugins/hoster/ARD.py +++ /dev/null @@ -1,83 +0,0 @@ -import subprocess -import re -import os.path -import os - -from module.utils import save_join, save_path -from module.plugins.Hoster import Hoster - -# Requires rtmpdump -# by Roland Beermann - - -class RTMP: - # TODO: Port to some RTMP-library like rtmpy or similar - # TODO?: Integrate properly into the API of pyLoad - - command = "rtmpdump" - - @classmethod - def download_rtmp_stream(cls, url, output_file, playpath=None): - opts = [ - "-r", url, - "-o", output_file, - ] - if playpath: - opts.append("--playpath") - opts.append(playpath) - - cls._invoke_rtmpdump(opts) - - @classmethod - def _invoke_rtmpdump(cls, opts): - args = [ - cls.command - ] - args.extend(opts) - - return subprocess.check_call(args) - - -class ARD(Hoster): - __name__ = "ARD Mediathek" - __version__ = "0.12" - __pattern__ = r"http://www\.ardmediathek\.de/.*" - __config__ = [] - - def process(self, pyfile): - site = self.load(pyfile.url) - - avail_videos = re.findall( - r'mediaCollection.addMediaStream\(0, ([0-9]*), "([^\"]*)", "([^\"]*)", "[^\"]*"\);', site) - avail_videos.sort(key=lambda videodesc: int(videodesc[0]), - reverse=True) # The higher the number, the better the quality - - quality, url, playpath = avail_videos[0] - - pyfile.name = re.search(r"<h1>([^<]*)</h1>", site).group(1) - - if url.startswith("http"): - # Best quality is available over HTTP. Very rare. - self.download(url) - else: - pyfile.setStatus("downloading") - - download_folder = self.config['general']['download_folder'] - - location = save_join(download_folder, pyfile.package().folder) - - if not os.path.exists(location): - os.makedirs(location, int(self.config["permission"]["folder"], 8)) - - if self.config["permission"]["change_dl"] and os.name != "nt": - try: - uid = getpwnam(self.config["permission"]["user"])[2] - gid = getgrnam(self.config["permission"]["group"])[2] - - chown(location, uid, gid) - except Exception, e: - self.logWarning(_("Setting User and Group failed: %s") % str(e)) - - output_file = save_join(location, save_path(pyfile.name)) + os.path.splitext(playpath)[1] - - RTMP.download_rtmp_stream(url, playpath=playpath, output_file=output_file) |