sya

split youtube audio tracks, with an optional pyqt gui
git clone git://src.gearsix.net/sya
Log | Files | Refs | Atom | README

commit a01f511a70c5a8678db905a98f00b096d85be9ca
parent 8bf94aaff150db02052591ff3ef7794ef59b3e04
Author: gearsix <gearsix@tuta.io>
Date:   Thu,  1 Dec 2022 17:05:13 +0000

v1.0.1 changes, Merge branch 'develop'

Diffstat:
Msya-pyqt.py | 11+++++++++--
Msya.py | 6++++--
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/sya-pyqt.py b/sya-pyqt.py @@ -140,7 +140,7 @@ class SyaGui(qtwidg.QMainWindow): self.loggerTextbox.clear() def show_help(self): - x = self.options.x() - self.options.width() - 50 + x = self.options.x() - self.options.width() - 100 y = self.options.y() - self.options.height() self.help.move(x, y) self.help.show() @@ -151,6 +151,10 @@ class SyaGui(qtwidg.QMainWindow): self.optionsHelp.setEnabled(True) def preMain(self): + x = self.options.x() + self.options.width() + 50 + y = self.options.y() - self.options.height() + self.logger.move(x, y) + self.logger.setWindowTitle('sya {}'.format(self.fnSyaArgs.output)) self.optionsOk.setEnabled(False) self.loggerDone.setEnabled(False) @@ -168,7 +172,6 @@ class SyaGui(qtwidg.QMainWindow): self.main_t.started.connect(self.preMain) self.main_t.finished.connect(self.postMain) - self.logger.setWindowTitle(self.fnSyaArgs.output) self.logger.show() self.running += 1 self.main_t.start() @@ -229,6 +232,8 @@ class SyaGui(qtwidg.QMainWindow): def _init_options_output(self): label = self.outputLabel layout, self.optionsOutput = sya_gui_filepicker(self.options, label, self.select_output, self.set_output, self.optionsValue[label], 'folder') + if self.optionsValue[self.tracklistLabel] != None and self.optionsValue[self.tracklistLabel] != '': + self.set_output(os.path.splitext(self.optionsValue[self.tracklistLabel])[0]) return layout def _init_options_keep(self): @@ -292,6 +297,8 @@ class SyaGui(qtwidg.QMainWindow): # Help Widget def _init_help(self): self.help = qtwidg.QTextEdit() + self.help.setWindowIcon(qtgui.QIcon(resource_path('sya.png'))) + self.help.setWindowTitle('sya help') with open(resource_path("HELP.md")) as f: self.help.setMarkdown(f.read()) self.help.resize(500, 500) diff --git a/sya.py b/sya.py @@ -7,7 +7,9 @@ import re import os import sys -Timestamp = re.compile('[\[\(]?((\d+:)+(\d+))[\]\)]?') +Version = 'v1.0.1' + +Timestamp = re.compile('(?:[\t ]+?)?[\[\(]+?((\d+[:.])+(\d+))[\]\)]?(?:[\t ]+)?') class TracklistItem: def __init__(self, timestamp, title): @@ -64,7 +66,7 @@ def parse_tracks(tracklist): continue elif Timestamp.match(l): if timestamp == None or weightR > weightL: - timestamp = l.strip('[()]') + timestamp = l.strip(' \t[()]') if i == 0: weightL += 1 else: