summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/YoutubeCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-08-30 03:38:54 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-08-30 03:38:54 +0200
commitf44acc14fc6492f9fefbc707618c774d34ac1aeb (patch)
treeb091de5877b31f4cbf8aff8ba0e5a1259fbde19c /module/plugins/hoster/YoutubeCom.py
parentMerge pull request #1779 from GammaC0de/patch-5 (diff)
downloadpyload-f44acc14fc6492f9fefbc707618c774d34ac1aeb.tar.xz
Fix https://github.com/pyload/pyload/issues/1793
Diffstat (limited to 'module/plugins/hoster/YoutubeCom.py')
-rw-r--r--module/plugins/hoster/YoutubeCom.py26
1 files changed, 3 insertions, 23 deletions
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index 9c7421be1..5c7c13962 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -6,37 +6,17 @@ import subprocess
import urllib
from module.plugins.internal.Hoster import Hoster
-from module.plugins.internal.Plugin import replace_patterns
+from module.plugins.internal.Plugin import replace_patterns, which
from module.utils import html_unescape
-def which(program):
- """
- Works exactly like the unix command which
- Courtesy of http://stackoverflow.com/a/377028/675646
- """
- isExe = lambda x: os.path.isfile(x) and os.access(x, os.X_OK)
-
- fpath, fname = os.path.split(program)
-
- if fpath:
- if isExe(program):
- return program
- else:
- for path in os.environ['PATH'].split(os.pathsep):
- path = path.strip('"')
- exe_file = os.path.join(path, program)
- if isExe(exe_file):
- return exe_file
-
-
class YoutubeCom(Hoster):
__name__ = "YoutubeCom"
__type__ = "hoster"
- __version__ = "0.45"
+ __version__ = "0.46"
__status__ = "testing"
- __pattern__ = r'https?://(?:[^/]*\.)?(youtube\.com/watch\?v=|youtu\.be)(?:.*)'
+ __pattern__ = r'https?://(?:[^/]*\.)?(youtu\.be/|youtube\.com/watch\?(?:.*&)?v=)\w+'
__config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting" , "hd" ),
("fmt" , "int" , "FMT/ITAG Number (0 for auto)", 0 ),
(".mp4" , "bool" , "Allow .mp4" , True ),