示例#1
0
 def get_file(self, entry, download_queue):
     try:
         file = audiojack.select(entry, self.config.get("main", "download_path"))
         download_queue.put(file)
     except DownloadError as e:
         if "ffprobe" in str(e) or "ffmpeg" in str(e):  # Checks if the error is cause by ffmpeg not being installed
             file = "%s/Downloads/%s.temp" % (os.path.expanduser("~"), audiojack.title)  # Delete temp file
             try:
                 os.remove(file)
             except Exception:
                 pass
             download_queue.put(0)
示例#2
0
 def get_file(self, index, download_queue):
     try:
         file = audiojack.select(index)
         download_queue.put(file)
     except DownloadError as e:
         if 'ffprobe' in str(e) or 'ffmpeg' in str(e): # Checks if the error is cause by ffmpeg not being installed
             file = '%s/Downloads/%s.temp' % (os.path.expanduser('~'), audiojack.title) # Delete temp file
             try:
                 os.remove(file)
             except Exception:
                 pass
             download_queue.put(0)
示例#3
0
 def custom(self, url):
     entry = {
         "artist": self.artist_input.get(0.0, END).replace("\n", ""),
         "title": self.title_input.get(0.0, END).replace("\n", ""),
         "album": self.album_input.get(0.0, END).replace("\n", ""),
         "url": url,
     }
     try:
         with open(self.cover_art_path.get().replace("\n", ""), "rb") as file:
             entry["img"] = file.read().encode("base64")
     except IOError:
         print("File not found")
     self.reset()
     file = audiojack.select(entry).replace("/", "\\")
     text = "Open %s" % file
     self.file = ttk.Button(self.mainframe, text=text, command=partial(self.open_file, file))
     self.file.pack()
示例#4
0
 def custom(self, url):
     entry = {
         'artist': self.artist_input.get(0.0, END).replace('\n', ''),
         'title': self.title_input.get(0.0, END).replace('\n', ''),
         'album': self.album_input.get(0.0, END).replace('\n', ''),
         'url': url
     }
     try:
         with open(self.cover_art_path.get().replace('\n', ''), 'rb') as file:
             entry['img'] = file.read().encode('base64')
     except IOError:
         print('File not found')
     self.reset()
     file = audiojack.select(entry).replace('/', '\\')
     text = 'Open %s' % file
     self.file = ttk.Button(self.mainframe, text=text, command=partial(self.open_file, file))
     self.file.pack()
示例#5
0
 def get_select(self, entry):
     try:
         self.download_queue.put(audiojack.select(entry))
     except Exception:
         self.download_queue.put('')
示例#6
0
 def get_select(self, entry):
     try:
         self.download_queue.put(audiojack.select(entry))
     except Exception:
         self.download_queue.put('')