feat(fws-music-dl): add legal disclaimer on startup
Shows a dismissable notice at first launch (and from the menu) stating that the software is Swiss, that downloads are only allowed for strictly personal use under art. 19 LDA, and that it is illegal in countries without an equivalent exception. Bumps the package to 1.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a92bc3a0b
commit
c87492cd66
3 files changed
+53
-2
No files matched your search
@@ -12,7 +12,7 @@ Un paquet = un dossier contenant son `PKGBUILD` et ses fichiers.
|
||||
|
||||
| Paquet | Version | Description |
|
||||
|---|---|---|
|
||||
| `fws-music-dl` | 1.0.0 | Téléchargeur YouTube / YouTube Music : recherche, MP3/M4A/Opus/FLAC ou vidéo MP4 |
|
||||
| `fws-music-dl` | 1.1.0 | Téléchargeur YouTube / YouTube Music : recherche, MP3/M4A/Opus/FLAC ou vidéo MP4 |
|
||||
|
||||
## Construire un paquet
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# (ou pkgrel pour un simple correctif), puis makepkg.
|
||||
# ============================================================================
|
||||
pkgname=fws-music-dl
|
||||
pkgver=1.0.0
|
||||
pkgver=1.1.0
|
||||
pkgrel=1
|
||||
pkgdesc="Téléchargeur YouTube / YouTube Music de FWS : recherche, MP3/M4A/Opus/FLAC ou vidéo MP4, pochettes et tags"
|
||||
arch=('any')
|
||||
|
||||
@@ -32,6 +32,24 @@ from gi.repository import Adw, Gdk, Gio, GLib, Gtk # noqa: E402
|
||||
APP_ID = "org.fws.MusicDownloader"
|
||||
DEPS = ["yt-dlp", "yt-dlp-ejs", "deno", "ffmpeg", "python-mutagen"]
|
||||
LOG_PATH = os.path.join(GLib.get_user_cache_dir(), "fws", "music-dl.log")
|
||||
# Présent = l'utilisateur a coché « Ne plus afficher » sous l'avertissement.
|
||||
DISCLAIMER_FLAG = os.path.join(GLib.get_user_config_dir(), "fws", "music-dl-disclaimer-accepted")
|
||||
|
||||
DISCLAIMER = (
|
||||
"<b>Logiciel suisse — usage strictement personnel</b>\n\n"
|
||||
"Ce logiciel est conçu en Suisse. Le droit suisse (art. 19 de la loi sur le "
|
||||
"droit d'auteur, LDA) autorise la copie d'œuvres pour un <b>usage strictement "
|
||||
"personnel</b> ou dans le cercle de personnes étroitement liées (parents, amis "
|
||||
"proches).\n\n"
|
||||
"Sont en revanche interdits, y compris en Suisse : <b>partager, publier, "
|
||||
"revendre ou mettre à disposition</b> les fichiers téléchargés.\n\n"
|
||||
"<b>Hors de Suisse</b>, dans un pays dont la loi ne prévoit pas la même "
|
||||
"exception, télécharger des œuvres protégées sans l'autorisation des ayants "
|
||||
"droit est <b>illégal</b>. Les conditions d'utilisation de YouTube peuvent en "
|
||||
"outre l'interdire.\n\n"
|
||||
"En utilisant ce logiciel, tu es seul responsable du respect des lois de ton "
|
||||
"pays. Ce texte est une information, pas un conseil juridique."
|
||||
)
|
||||
|
||||
# (libellé, args yt-dlp, vidéo ?).
|
||||
# Opus et M4A sont les flux d'ORIGINE de YouTube : pas de réencodage, donc pas
|
||||
@@ -116,6 +134,7 @@ class Window(Adw.ApplicationWindow):
|
||||
menu = Gio.Menu()
|
||||
menu.append("Réparer / mettre à jour les outils", "app.repair")
|
||||
menu.append("Ouvrir le journal", "app.log")
|
||||
menu.append("Avertissement légal", "app.disclaimer")
|
||||
mbtn = Gtk.MenuButton(icon_name="open-menu-symbolic", menu_model=menu)
|
||||
header.pack_end(mbtn)
|
||||
|
||||
@@ -227,6 +246,34 @@ class Window(Adw.ApplicationWindow):
|
||||
with open(LOG_PATH, "a", encoding="utf-8") as f:
|
||||
f.write(line.rstrip("\n") + "\n")
|
||||
|
||||
# --- Avertissement légal ---
|
||||
# forced=True : réaffiché depuis le menu, même après « Ne plus afficher ».
|
||||
def show_disclaimer(self, forced=False):
|
||||
if not forced and os.path.exists(DISCLAIMER_FLAG):
|
||||
return
|
||||
dlg = Adw.AlertDialog(heading="Avertissement", body=DISCLAIMER, body_use_markup=True)
|
||||
check = Gtk.CheckButton(label="J'ai compris, ne plus afficher ce message",
|
||||
active=os.path.exists(DISCLAIMER_FLAG))
|
||||
dlg.set_extra_child(check)
|
||||
if not forced:
|
||||
dlg.add_response("quit", "Quitter")
|
||||
dlg.add_response("ok", "J'ai compris")
|
||||
dlg.set_response_appearance("ok", Adw.ResponseAppearance.SUGGESTED)
|
||||
dlg.set_default_response("ok")
|
||||
dlg.set_close_response("quit" if not forced else "ok")
|
||||
|
||||
def resp(_d, r):
|
||||
if r == "quit":
|
||||
self.get_application().quit()
|
||||
return
|
||||
if check.get_active():
|
||||
os.makedirs(os.path.dirname(DISCLAIMER_FLAG), exist_ok=True)
|
||||
open(DISCLAIMER_FLAG, "w").close()
|
||||
elif os.path.exists(DISCLAIMER_FLAG):
|
||||
os.remove(DISCLAIMER_FLAG)
|
||||
dlg.connect("response", resp)
|
||||
dlg.present(self)
|
||||
|
||||
def refresh_deps(self):
|
||||
miss = missing_deps()
|
||||
self.deps_banner.set_revealed(bool(miss))
|
||||
@@ -502,6 +549,9 @@ class App(Adw.Application):
|
||||
a = Gio.SimpleAction.new("repair", None)
|
||||
a.connect("activate", lambda *_: self.win.install_deps(reinstall=True))
|
||||
self.add_action(a)
|
||||
a = Gio.SimpleAction.new("disclaimer", None)
|
||||
a.connect("activate", lambda *_: self.win.show_disclaimer(forced=True))
|
||||
self.add_action(a)
|
||||
a = Gio.SimpleAction.new("log", None)
|
||||
a.connect("activate", self.open_log)
|
||||
self.add_action(a)
|
||||
@@ -515,6 +565,7 @@ class App(Adw.Application):
|
||||
if not self.win:
|
||||
self.win = Window(self)
|
||||
self.win.present()
|
||||
self.win.show_disclaimer()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user