summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/YoutubeCom.py
diff options
context:
space:
mode:
authorGravatar enkore <public@enkore.de> 2013-03-26 13:48:34 +0100
committerGravatar enkore <public@enkore.de> 2013-03-26 13:48:34 +0100
commitba5b01cc56ab2d99f51ee3b6bd21bac90e2c806d (patch)
treec5bd0e99f86408f9916a6d5e4a2e600c0042219b /module/plugins/hoster/YoutubeCom.py
parentYoutubeCom: Show start time in package name (diff)
downloadpyload-ba5b01cc56ab2d99f51ee3b6bd21bac90e2c806d.tar.xz
YoutubeCom: fix program flow quirks
Diffstat (limited to 'module/plugins/hoster/YoutubeCom.py')
-rw-r--r--module/plugins/hoster/YoutubeCom.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index f01094c7d..ce9fe4945 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -139,7 +139,8 @@ class YoutubeCom(Hoster):
pyfile.name = html_unescape(name)
time = re.search(r"t=((\d+)m)?(\d+)s", pyfile.url)
- if time:
+ ffmpeg = which("ffmpeg")
+ if ffmpeg and time:
m, s = time.groups()[1:]
if not m:
m = "0"
@@ -148,8 +149,7 @@ class YoutubeCom(Hoster):
filename = self.download(url)
- ffmpeg = which("ffmpeg")
- if ffmpeg:
+ if ffmpeg and time:
inputfile = filename + "_"
os.rename(filename, inputfile)