Browse Source

Change youtube-dl download path

doc-issue-template
MrS0m30n3 11 years ago
parent
commit
efb3848773
2 changed files with 11 additions and 2 deletions
  1. 2
      youtube_dl_gui/OptionsHandler.py
  2. 11
      youtube_dl_gui/UpdateThread.py

2
youtube_dl_gui/OptionsHandler.py

@ -63,7 +63,7 @@ class OptionsHandler():
self.username = ""
self.password = ""
self.videoPass = ""
self.updatePath = abs_path(__file__)
self.updatePath = self.get_config_path()
self.cmdArgs = ""
self.enableLog = True
self.writeTimeToLog = True

11
youtube_dl_gui/UpdateThread.py

@ -7,7 +7,11 @@ from wx.lib.pubsub import pub as Publisher
from threading import Thread
from urllib2 import urlopen, URLError, HTTPError
from .Utils import fix_path
from .Utils import (
fix_path,
file_exist,
makedir
)
LATEST_YOUTUBE_DL = 'https://yt-dl.org/latest/'
PUBLISHER_TOPIC = 'update'
@ -20,6 +24,7 @@ class UpdateThread(Thread):
self.youtubeDLFile = youtubeDLFile
self.updatePath = fix_path(updatePath)
self.url = LATEST_YOUTUBE_DL + youtubeDLFile
self.check_path()
self.start()
def run(self):
@ -33,3 +38,7 @@ class UpdateThread(Thread):
msg = 'Youtube-dl download failed ' + str(e)
CallAfter(Publisher.sendMessage, PUBLISHER_TOPIC, msg)
CallAfter(Publisher.sendMessage, PUBLISHER_TOPIC, 'finish')
def check_path(self):
if not file_exist(self.updatePath):
makedir(self.updatePath)
Loading…
Cancel
Save