Compare commits

...

15 Commits

Author SHA1 Message Date
DYefremov
0894cb5a47 *.spec files update 2023-06-25 18:08:32 +03:00
DYefremov
1ac6537496 win style adjustment 2023-06-23 23:37:16 +03:00
DYefremov
285ea66197 lazy filtering 2023-06-23 23:33:50 +03:00
DYefremov
1edb313e2c minor filter optimization 2023-06-19 23:20:53 +03:00
DYefremov
c9755e0116 win style update 2023-06-18 12:30:41 +03:00
DYefremov
367a4a2e36 alternate title option for Windows 2023-06-14 17:31:29 +03:00
DYefremov
fc65ee29ee minor changes in settings dialog 2023-06-14 17:18:26 +03:00
DYefremov
f0e9684f51 version update 2023-06-14 12:49:51 +03:00
DYefremov
7084eec407 translations update 2023-06-14 12:16:23 +03:00
DYefremov
ef79dac603 skipping services with empty params for kos 2023-06-13 23:04:09 +03:00
audi06_19
89ee80e4ef Update: Turkish translation update (#181) 2023-06-10 19:08:07 +03:00
DYefremov
73df75a519 switching to yt-dlp 2023-06-06 17:41:23 +03:00
DYefremov
7ed0d6d355 playback adjustment for macOS 2023-06-06 11:39:16 +03:00
DYefremov
b4a0a72db3 debug message output adjustment 2023-06-06 10:05:49 +03:00
DYefremov
63e0f1ea14 deb script adjustment 2023-06-06 09:49:36 +03:00
30 changed files with 124 additions and 82 deletions

View File

@@ -711,6 +711,10 @@ class ServicesParser(HTMLParser):
sr, fec = sr_fec.split()
pol = get_key_by_value(POLARIZATION, pol)
sys, mod, fec, nsp, s2_flags, roll_off, pilot, inv = self.get_transponder_data(pos, fec, sys, mod)
if not all((freq, nid, tid)):
log(f"Error. Not enough parameters [Frequency={freq}, NID={nid}, TID={tid}].")
continue
freq, nid, tid = int(float(freq)), int(nid), int(tid)
tr = self._TR.format(freq, sr, pol, fec, pos, inv, sys, s2_flags)

View File

@@ -111,7 +111,7 @@ class YouTube:
if not self._yt_dl:
self._yt_dl = YouTubeDL.get_instance(self._settings, self._callback)
if not self._yt_dl:
raise YouTubeException("youtube-dl initialization error.")
raise YouTubeException("yt-dlp initialization error.")
return self._yt_dl.get_yt_link(url, skip_errors)
return self.get_yt_link_by_id(video_id)
@@ -148,7 +148,7 @@ class YouTube:
if self._settings.enable_yt_dl and url:
try:
if not self._yt_dl:
raise YouTubeException("youtube-dl is not initialized!")
raise YouTubeException("yt-dlp is not initialized!")
self._yt_dl.update_options({"noplaylist": False, "extract_flat": True})
info = self._yt_dl.get_info(url, skip_errors=False)
@@ -307,14 +307,14 @@ class PlayListParser(HTMLParser):
class YouTubeDL:
""" Utility class [experimental] for working with youtube-dl.
""" Utility class [experimental] for working with yt-dlp.
[https://github.com/ytdl-org/youtube-dl]
[https://github.com/yt-dlp/yt-dlp]
"""
_DL_INSTANCE = None
_DownloadError = None
_LATEST_RELEASE_URL = "https://api.github.com/repos/ytdl-org/youtube-dl/releases/latest"
_LATEST_RELEASE_URL = "https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest"
_OPTIONS = {"noplaylist": True, # Single video instead of a playlist [ignoring playlist in URL].
"extract_flat": False, # Do not resolve URLs, return the immediate result.
"quiet": True, # Do not print messages to stdout.
@@ -339,7 +339,7 @@ class YouTubeDL:
return cls._DL_INSTANCE
def init(self):
if not os.path.isfile(f"{self._path}youtube_dl{SEP}version.py"):
if not os.path.isfile(f"{self._path}yt_dlp{SEP}version.py"):
self.get_latest_release()
if self._path not in sys.path:
@@ -349,39 +349,39 @@ class YouTubeDL:
def init_dl(self):
try:
import youtube_dl
import yt_dlp
except ModuleNotFoundError as e:
log(f"YouTubeDLHelper error: {e}")
raise YouTubeException(e)
except ImportError as e:
log(f"YouTubeDLHelper error: {e}")
else:
if self._path not in youtube_dl.__file__:
msg = "Another version of youtube-dl was found on your system!"
if self._path not in yt_dlp.__file__:
msg = "Another version of yt-dlp was found on your system!"
log(msg)
raise YouTubeException(msg)
if self._update:
if hasattr(youtube_dl.version, "__version__"):
if hasattr(yt_dlp.version, "__version__"):
l_ver = self.get_last_release_id()
cur_ver = youtube_dl.version.__version__
if l_ver and youtube_dl.version.__version__ < l_ver:
msg = f"youtube-dl has new release!\nCurrent: {cur_ver}. Last: {l_ver}."
cur_ver = yt_dlp.version.__version__
if l_ver and yt_dlp.version.__version__ < l_ver:
msg = f"yt-dlp has new release!\nCurrent: {cur_ver}. Last: {l_ver}."
show_notification(msg)
log(msg)
self._callback(msg, False)
self.get_latest_release()
self._DownloadError = youtube_dl.utils.DownloadError
self._dl = youtube_dl.YoutubeDL(self._OPTIONS)
msg = "youtube-dl initialized..."
self._DownloadError = yt_dlp.utils.DownloadError
self._dl = yt_dlp.YoutubeDL(self._OPTIONS)
msg = "yt-dlp initialized..."
show_notification(msg)
log(msg)
@staticmethod
def get_last_release_id():
""" Getting last release id. """
url = "https://api.github.com/repos/ytdl-org/youtube-dl/releases/latest"
url = "https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest"
try:
with urlopen(url, timeout=10) as resp:
return json.loads(resp.read().decode("utf-8")).get("tag_name", "0")
@@ -391,7 +391,7 @@ class YouTubeDL:
def get_latest_release(self):
try:
self._is_update_process = True
log("Getting the last youtube-dl release...")
log("Getting the last yt-dlp release...")
with urlopen(YouTubeDL._LATEST_RELEASE_URL, timeout=10) as resp:
r = json.loads(resp.read().decode("utf-8"))
@@ -400,7 +400,7 @@ class YouTubeDL:
if os.path.isdir(self._path):
shutil.rmtree(self._path)
zip_file = self._path + "yt.zip"
zip_file = f"{self._path}yt.zip"
os.makedirs(os.path.dirname(self._path), exist_ok=True)
f_name, headers = urlretrieve(zip_url, filename=zip_file)
@@ -408,12 +408,12 @@ class YouTubeDL:
with zipfile.ZipFile(f_name) as arch:
for info in arch.infolist():
pref, sep, f = info.filename.partition("/youtube_dl/")
pref, sep, f = info.filename.partition("/yt_dlp/")
if sep:
arch.extract(info.filename)
shutil.move(info.filename, f"{self._path}{sep}{f}")
shutil.rmtree(pref)
msg = "Getting the last youtube-dl release is done!"
msg = "Getting the last yt-dlp release is done!"
show_notification(msg)
log(msg)
self._callback(msg, False)

View File

@@ -40,7 +40,7 @@ Author: Dmitriy Yefremov
<property name="icon_name">system-help</property>
<property name="type_hint">normal</property>
<property name="program_name">DemonEditor</property>
<property name="version">3.7.0 Alpha</property>
<property name="version">3.7.0 Beta</property>
<property name="copyright">2018-2023 Dmitriy Yefremov
</property>
<property name="comments" translatable="yes">Enigma2 channel and satellite list editor.</property>

View File

@@ -1657,7 +1657,7 @@ Author: Dmitriy Yefremov
<object class="GtkLabel" id="app_ver_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">3.7.0 Alpha</property>
<property name="label">3.7.0 Beta</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>

View File

@@ -509,7 +509,7 @@ class Application(Gtk.Application):
toolbar_box = builder.get_object("toolbar_main_box")
if self._settings.use_header_bar:
header_bar = HeaderBar()
if not IS_DARWIN:
if IS_LINUX:
header_bar.pack_start(builder.get_object("file_header_button"))
header_bar.pack_start(profile_box)
@@ -639,8 +639,10 @@ class Application(Gtk.Application):
elif d_op == "off":
self._settings.debug_mode = False
else:
log("No valid [on, off] arguments for -d found!")
msg = "No valid [on, off] arguments for -d found!"
log(msg) if "log" in options else print(msg)
return 1
log(f"Debug mode is {d_op}.")
self._settings.save()
@@ -801,7 +803,7 @@ class Application(Gtk.Application):
sa.connect("change-state", self.on_layout_change)
# Header bar for macOS.
sa = self.set_state_action("set_alternate_title", self.set_use_alt_title, self._settings.use_header_bar)
sa.set_enabled(IS_DARWIN)
sa.set_enabled(not IS_LINUX)
# Menu bar and playback.
self.set_action("on_playback_close", self._player_box.on_close)
if not USE_HEADER_BAR:
@@ -3714,7 +3716,10 @@ class Application(Gtk.Application):
active = not self._filter_box.get_visible()
self._filter_services_button.set_active(active)
self._filter_entry.grab_focus() if active else self.on_filter_changed()
if active:
self._filter_entry.grab_focus()
elif len(self._services_model) != len(self._services_model_filter):
self.on_filter_changed()
self.filter_set_default()
self._filter_box.set_visible(active)
@@ -3723,7 +3728,10 @@ class Application(Gtk.Application):
return True
active = not self._iptv_filter_box.get_visible()
self._iptv_filter_entry.grab_focus() if active else self.on_iptv_filter_changed()
if active:
self._iptv_filter_entry.grab_focus()
elif len(self._iptv_model) != len(self._iptv_services_model_filter):
self.on_iptv_filter_changed()
self._iptv_filter_box.set_visible(active)
# Defaults.
self.iptv_filter_set_default()
@@ -3781,25 +3789,39 @@ class Application(Gtk.Application):
update_filter_sat_positions(self._filter_sat_pos_model, self._sat_positions)
@run_with_delay(2)
@run_with_delay(1)
def on_filter_changed(self, item=None):
self._services_load_spinner.start()
self.update_filter_cache()
self.update_filter_state()
@run_with_delay(2)
@run_with_delay(1)
def on_iptv_filter_changed(self, item=None):
self.update_iptv_filter_cache()
self.update_iptv_filter_state()
@run_idle
def update_filter_state(self):
self._services_model_filter.refilter()
GLib.idle_add(self._services_load_spinner.stop)
factor = self.DEL_FACTOR * 2
refresh = len(self._services_model_filter) > factor and self._filter_services_button.get_active()
gen = self.refilter(self._services_view, self._services_model, factor, refresh)
GLib.idle_add(lambda: next(gen, False))
@run_idle
def update_iptv_filter_state(self):
self._iptv_services_model_filter.refilter()
factor = self.DEL_FACTOR * 2
refresh = len(self._iptv_services_model_filter) > factor and self._filter_iptv_services_button.get_active()
gen = self.refilter(self._iptv_services_view, self._iptv_model, factor, refresh)
GLib.idle_add(lambda: next(gen, False))
def refilter(self, view, model, factor=100, refresh=False):
main_model = view.get_model()
view.set_model(None) if refresh else None
for i, r in enumerate(model.emit("row-changed", r.path, r.iter) for r in model):
if i % factor == 0:
yield True
view.set_model(main_model)
GLib.idle_add(self._services_load_spinner.stop)
def update_filter_cache(self):
self._filter_cache.clear()

View File

@@ -180,7 +180,7 @@ class PlayerBox(Gtk.Overlay):
def on_page_changed(self, app, page):
self._page = page
if self._player:
self.update_buttons()
self.update_buttons() if not IS_DARWIN else None
self.on_close()
self.set_visible(False)
@@ -251,8 +251,7 @@ class PlayerBox(Gtk.Overlay):
self.emit("pause", None)
def on_stop(self, action=None, value=None):
if not IS_DARWIN:
self._stop_button.set_visible(False)
self._stop_button.set_visible(False) if not IS_DARWIN else None
self.emit("stop", None)
def on_next(self, button):
@@ -264,7 +263,7 @@ class PlayerBox(Gtk.Overlay):
def switch_service(self, count):
self._fav_view.grab_focus()
if self._fav_view.do_move_cursor(self._fav_view, Gtk.MovementStep.DISPLAY_LINES, count):
self.update_buttons()
self.update_buttons() if not IS_DARWIN else None
self.set_player_action()
def on_rewind(self, scale, scroll_type, value):

View File

@@ -577,7 +577,7 @@ Author: Dmitriy Yefremov
<object class="GtkFrame" id="local_file_paths_frame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label-xalign">0.05000000074505806</property>
<property name="label-xalign">0.02</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkBox" id="local_paths_box">
@@ -2921,24 +2921,24 @@ Author: Dmitriy Yefremov
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">EXPERIMENTAL!</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="experimental_features_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<child type="center">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">EXPERIMENTAL!</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="enable_experimental_label">
<property name="visible">True</property>
@@ -3079,7 +3079,7 @@ Author: Dmitriy Yefremov
<object class="GtkBox" id="enable_yt_dl_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Enables URL parsing using youtube-dl to get direct links to media.</property>
<property name="tooltip-text" translatable="yes">Enables URL parsing using yt-dlp to get direct links to media.</property>
<child>
<object class="GtkLabel" id="enable_yt_dl_label">
<property name="visible">True</property>
@@ -3109,7 +3109,7 @@ Author: Dmitriy Yefremov
</child>
<child>
<object class="GtkLinkButton" id="yt_dl_link_button">
<property name="label">youtube-dl</property>
<property name="label">yt-dlp</property>
<property name="name">status-bar-button</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
@@ -3117,7 +3117,7 @@ Author: Dmitriy Yefremov
<property name="halign">start</property>
<property name="valign">center</property>
<property name="relief">none</property>
<property name="uri">https://youtube-dl.org/</property>
<property name="uri">https://github.com/yt-dlp/yt-dlp</property>
</object>
<packing>
<property name="expand">True</property>
@@ -3225,7 +3225,7 @@ Author: Dmitriy Yefremov
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>

View File

@@ -22,3 +22,7 @@ grid > button {
popover .view {
background-color: transparent;
}
headerbar .titlebutton > image {
padding: 0;
}

View File

@@ -1,5 +1,5 @@
#!/bin/bash
VER="3.7.0_Alpha"
VER="3.7.0_Beta"
B_PATH="dist/DemonEditor"
DEB_PATH="$B_PATH/usr/share/demoneditor"

View File

@@ -1,5 +1,5 @@
Package: demon-editor
Version: 3.7.0-Alpha
Version: 3.7.0-Beta
Section: utils
Priority: optional
Architecture: all

View File

@@ -1,2 +1,2 @@
#!/bin/bash
python3 /usr/share/demoneditor/start.py $1
python3 /usr/share/demoneditor/start.py $@

View File

@@ -32,7 +32,7 @@ a = Analysis([EXE_NAME],
pathex=PATH_EXE,
binaries=None,
datas=ui_files,
hiddenimports=['fileinput', 'uuid'],
hiddenimports=['fileinput', 'uuid', 'asyncio'],
hookspath=[],
runtime_hooks=[],
hooksconfig={
@@ -81,7 +81,7 @@ app = BUNDLE(coll,
'CFBundleGetInfoString': "Enigma2 channel and satellite editor",
'LSApplicationCategoryType': 'public.app-category.utilities',
'LSMinimumSystemVersion': '10.13',
'CFBundleShortVersionString': f"3.7.0.{BUILD_DATE} Alpha",
'CFBundleShortVersionString': f"3.7.0.{BUILD_DATE} Beta",
'NSHumanReadableCopyright': u"Copyright © 2023, Dmitriy Yefremov",
'NSRequiresAquaSystemAppearance': 'false',
'NSHighResolutionCapable': 'true'

View File

@@ -30,7 +30,7 @@ a = Analysis([EXE_NAME],
pathex=PATH_EXE,
binaries=[],
datas=ui_files,
hiddenimports=['fileinput', 'uuid', 'ctypes.wintypes'],
hiddenimports=['fileinput', 'uuid', 'ctypes.wintypes', 'asyncio'],
hookspath=[],
runtime_hooks=[],
hooksconfig={

View File

@@ -1358,8 +1358,8 @@ msgstr "Усе букеты"
msgid "Playback from the main list"
msgstr "Прайграванне з асноўнага спіса"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Улучае аналіз URL-адрасоў з дапамогай youtube-dl для атрымання прамых спасылак на медыя."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Улучае аналіз URL-адрасоў з дапамогай yt-dlp для атрымання прамых спасылак на медыя."
msgid "Permissions..."
msgstr "Дазволы..."

6
po/build.sh Normal file → Executable file
View File

@@ -1,3 +1,7 @@
#!/bin/bash
#xgettext --keyword=translatable --sort-output -L Glade -o po/demon-editor.po app/ui/main_window.glade
#msgfmt demon-editor.po -o demon-editor.mo
for dir in */;
do
msgfmt $dir* -o ../app/ui/lang/${dir%/}/LC_MESSAGES/demon-editor.mo
done

View File

@@ -797,7 +797,7 @@ msgid "Apply profile settings"
msgstr "Profileinstellungen anwenden"
msgid "Settings type:"
msgstr "Art der Einstellungen:"
msgstr "Einstellungstyp:"
msgid "Set default"
msgstr "Standard wiederherstellen"
@@ -1372,8 +1372,8 @@ msgstr "Alle Bouquets"
msgid "Playback from the main list"
msgstr "Wiedergabe aus der Hauptliste"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Aktiviert URL-Parsing mit youtube-dl, um direkte Links zu Medien zu erhalten."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Aktiviert URL-Parsing mit yt-dlp, um direkte Links zu Medien zu erhalten."
msgid "Permissions..."
msgstr "Berechtigungen..."

View File

@@ -1386,8 +1386,8 @@ msgstr "Todos los bouquets"
msgid "Playback from the main list"
msgstr "Reproducción desde la lista principal"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Habilita el análisis de URL usando youtube-dl para obtener enlaces directos a los medios."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Habilita el análisis de URL usando yt-dlp para obtener enlaces directos a los medios."
msgid "Permissions..."
msgstr "Permisos..."

View File

@@ -1412,9 +1412,9 @@ msgstr "Tutti i bouquet"
msgid "Playback from the main list"
msgstr "Riproduci dall'elenco principale"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr ""
"Abilita l'analisi degli URL utilizzando youtube-dl per ottenere collegamenti"
"Abilita l'analisi degli URL utilizzando yt-dlp per ottenere collegamenti"
" diretti ai media."
msgid "Permissions..."

View File

@@ -1346,8 +1346,8 @@ msgstr "Alle boeketten"
msgid "Playback from the main list"
msgstr "Afspelen vanuit de hoofdlijst"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Schakelt URL-parsing met behulp van youtube-dl in, om directe links naar media te krijgen."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Schakelt URL-parsing met behulp van yt-dlp in, om directe links naar media te krijgen."
msgid "Permissions..."
msgstr "Rechten..."

View File

@@ -1376,8 +1376,8 @@ msgstr "Wszystkie bukiety"
msgid "Playback from the main list"
msgstr "Odtwarzanie z listy głównej"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Włącza parsowanie adresów URL przy użyciu youtube-dl w celu uzyskania bezpośrednich linków do multimediów."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Włącza parsowanie adresów URL przy użyciu yt-dlp w celu uzyskania bezpośrednich linków do multimediów."
msgid "Permissions..."
msgstr "Uprawnienia..."

View File

@@ -1355,8 +1355,8 @@ msgstr "Все букеты"
msgid "Playback from the main list"
msgstr "Воспроизведение из основного списка"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Включает анализ URL-адресов с помощью youtube-dl для получения прямых ссылок на медиа."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Включает анализ URL-адресов с помощью yt-dlp для получения прямых ссылок на медиа."
msgid "Permissions..."
msgstr "Разрешения..."

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: DemonEditor\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-04-16 15:59+0300\n"
"PO-Revision-Date: 2023-04-22 16:34+0300\n"
"PO-Revision-Date: 2023-06-10 17:50+0300\n"
"Last-Translator: audi06_19 <info@dreamosat-forum.com>\n"
"Language-Team: audi06_19 <info@dreamosat-forum.com>\n"
"Language: tr\n"
@@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.3.1\n"
msgid "translator-credits"
msgstr "audi06_19 <info@dreamosat-forum.com>"
@@ -1387,8 +1387,8 @@ msgstr "Tüm buketler"
msgid "Playback from the main list"
msgstr "Ana listeden oynatma"
msgid "Enables URL parsing using youtube-dl to get direct links to media."
msgstr "Medyaya doğrudan bağlantılar almak için youtube-dl kullanarak URL ayrıştırmayı etkinleştirir."
msgid "Enables URL parsing using yt-dlp to get direct links to media."
msgstr "Medyaya doğrudan bağlantılar almak için yt-dlp kullanarak URL ayrıştırmayı etkinleştirir."
msgid "Permissions..."
msgstr "İzinler..."
@@ -1519,3 +1519,12 @@ msgstr "Alternatif pencere başlığı"
msgid "Selected type:"
msgstr "Seçilen tip:"
msgid "Extension Manager"
msgstr "Eklenti Yöneticisi"
msgid "Ver."
msgstr "Ver."
msgid "Installed"
msgstr "Yüklenmiş"