Une place pour une véritable innovation. Partagez vos propres utilitaires créés avec la communauté Manjaro.
Questions et discussions sur la programmation et le codage.
Répondre

yaate : Yet Another Audio Tag Editor

#1Messageil y a 8 ans

Bien le bonjour à tous.

Ayant eu du mal à trouver un éditeur de tag pour les fichiers audio en ligne de commande qui me convienne, j'ai décidé d'en créer un.
Autant en terme d'interface graphique je trouve mon bonheur, notamment du côté de puddletag, autant du coté des CLI c'est assez limité...
J'ai bien essayé taffy et usetaglib, mais même si ils font bien leur boulot, ils se limitent à modifier les tags d'un seul fichier audio à la fois.
On peut bien sur faire des scripts avec ça, mais pour gérer quasi-automatiquement une bibliothèque musicale qui se respecte un peu, ça deviens vite compliqué, et ça demande donc pas mal d’expérience en programmation.
Le but était donc de créer une commande permettant de modifier en une ligne les meta-données audio d'un grand nombre de fichiers.

Après une petite semaine, je pense être arrivé à quelque chose de fonctionnel et permettant déjà de faire pas mal de chose.
Le tout est écrit en python en utilisant le module pytaglib qui propose des bindings pour la librairies TagLib.
La plupart des options d’édition de tags permettent l'utilisation d'expressions régulières pour permettre une grande flexibilité.
Pendant ce temps, j'ai déjà implémenté des opérateurs permettant de :
- faire une sélection de fichier sur les tags via des expression régulière notamment
- lister les tags
- supprimer des tags
- ajouter/modifier des tags de manière brute ou en fonction des tags déjà présent ou du chemin du fichier (dossier, nom de fichier etc.)
- faire de la substitution au sein des tags, encore une fois de manière brute ou en utilisant les informations déjà présente dans le fichier

Trêve de bavardage, voilà quelques exemples :

yaate --match="%filename%=%title%" --list <path>

Liste les tags de tous les fichiers audio contenus dans <path> et dont le nom de fichier contient leur titre (c'est à dire le tag TITLE).

yaate --match="%track%=^1; %track%=3$" --list <path>

Liste les tags de tous les fichiers audio contenus dans <path> et dont le numéro de piste commence par 1 et fini par 3.

yaate --match="%track%=^1" -l --match="%track%=3$" -l <path>

Liste les tags de tous les fichiers audio contenu dans <path> et dont le numéro de piste commence par 1, puis ensuite ceux dont le numéro de piste fini par 3.

yaate --keep="%album%;%artist%;%track%;%title%" <path>

Ne conserve que les tags ALBUM, ARTIST, TRACK et TITLE pour tous les fichiers de <path>.

yaate --sub="%title%=(.)\\1/\\1" <path>

Substitue dans le tag TITLE tous les caractères doublés (aa, bb, 00 etc.) par un seul de ces caractères.
On voit sur ce dernier l'apparition de références arrières liées au expressions régulières.

Voilà voilà, si vous voulez avoir une vue plus exhaustive des capacité du script, je vous encourage à utiliser l'option --help.
Il reste encore quelques fonctionnalités que j'aimerais implémenter, mais je pense qu'en l'état c'est déjà un outil très polyvalent.
Si vous voulez vous amuser à le tester, j'ai déjà créer un paquet sur l'AUR, il suffit d'un yaourt -S yaate.
Tout retour est évidemment plus que le bienvenu !
Si vous avez des questions concernant l'utilisation du script, n’hésitez pas non plus à les poser.

yaate : Yet Another Audio Tag Editor

#2Messageil y a 8 ans

Bonjour
Bravo et merci du partage :salut:
Je rencontre une erreur en chargeant la dépendance python-pytaglib:

==> Lancer la compilation de python-pytaglib ? [O/n]
==> ------------------------------------------------
==>
==> Construction et installation du paquet
==> Ce PKGBUILD fournit " python-pytaglib python2-pytaglib "
==> Installer seulement python-pytaglib ? [O/n]
==> -------------------------------------------
==>
makepkg: option invalide '--pkg'
==> ERREUR: Makepkg n'a pas pu construire python-pytaglib.

[Procrastination]Tu es aussi l'auteur de ce paquet, ou il faut que je cherche ? [/Procrastination] :gsourire:

yaate : Yet Another Audio Tag Editor

#3Messageil y a 8 ans

Non, celui là n'est pas de moi du tout :maisnon:

Je viens de ressayer d'installer le paquet chez moi et je n'ai pas de problème.
En revanche je n'ai pas eu ce message :

==> Ce PKGBUILD fournit " python-pytaglib python2-pytaglib "
==> Installer seulement python-pytaglib ? [O/n]
==> -------------------------------------------

Peut être que ça viens de là ?

Sinon tu peux toujours installer pytaglib via pip (paquet python-pip) en utilisant la commande pip install pytaglib.
Et essayer le script en utilisant ce PKGBUILD (j'ai juste retiré la dépendance sur pytaglib) :

# Maintainer: N3mesis98 <adrienjacquet at openmailbox dot org>
pkgname=yaate
pkgver=1.0.1
pkgrel=1
pkgdesc="Simple yet powerful command line audio tag editor written in Python and using the TagLib library"
arch=('any')
url="https://github.com/N3mesis98/$pkgname"
license=('LGPL3+')
depends=('python' 'taglib')
makedepends=()
source=("https://github.com/N3mesis98/$pkgname/archive/$pkgver.tar.gz")
md5sums=('213e07323c06761deb8f7de77dfb7fdb')
provides=($pkgname)
conflicts=($pkgname)

package() {
   cd "$srcdir/$pkgname-$pkgver"
   install -D LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
   install -D $pkgname.py "$pkgdir/usr/bin/$pkgname"
}

yaate : Yet Another Audio Tag Editor

#4Messageil y a 8 ans

Yep ! Ça s'installe bien comme ça. :bien Il faudrait peut être mettre python-pip en dépendance . A mon avis, soit tu passes la commande pip install pytaglib dans prepare(), soit tu ajoutes un commentaire dans pkgdesc().

yaate : Yet Another Audio Tag Editor

#5Messageil y a 8 ans

Ce qui est bizarre c'est que le problème à l'air d'être lié à la gestion des paquets doubles par yaourt ou makepkg...
Pourrait tu essayer de réinstaller pytaglib via l'AUR en répondant non au message demandant si tu souhaite installer uniquement python-pytaglib ?

yaate : Yet Another Audio Tag Editor

#6Messageil y a 8 ans

Yes , ça roule.

[steph@Dell ~]$ sudo pip uninstall pytaglib
Uninstalling pytaglib-1.1.0:
  /usr/bin/pyprinttags3
  /usr/lib/python3.5/site-packages/__pycache__/pyprinttags.cpython-35.pyc
  /usr/lib/python3.5/site-packages/pyprinttags.py
  /usr/lib/python3.5/site-packages/pytaglib-1.1.0-py3.5.egg-info
  /usr/lib/python3.5/site-packages/taglib.cpython-35m-x86_64-linux-gnu.so
Proceed (y/n)? y
  Successfully uninstalled pytaglib-1.1.0
You are using pip version 8.0.3, however version 8.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

[steph@Dell ~]$ yaourt -S python-pytaglib

==> Téléchargement du PKGBUILD de python-pytaglib depuis AUR...
x .SRCINFO
x PKGBUILD
 
The 1.0.2 release tarball on PyPi does not contain the README.md needed by setup.py, the tarball from github however contains it.

 
Thanks; this is now fixed.

python-pytaglib 1.1.0-1  (2015-09-06 10:35)
( Paquet non supporté : peut être dangereux ! )
==> ATTENTION: Ce PKGBUILD décrit un paquet splitté.
==> Les options du paquet sont inconnues
==> Dépendances de python-pytaglib :
 - python-setuptools (déjà installé) [makedepend]
 - python2-setuptools (déjà installé) [makedepend]
 - taglib (déjà installé) [makedepend]


==> Lancer la compilation de python-pytaglib ? [O/n]
==> ------------------------------------------------
==>
==> Construction et installation du paquet
==> Ce PKGBUILD fournit " python-pytaglib python2-pytaglib "
==> Installer seulement python-pytaglib ? [O/n]
==> -------------------------------------------
==>
==> Création du paquet python-pytaglib 1.1.0-1 (dim. mars 13 19:16:27 CET 2016)
==> Vérification des dépendances pour l’exécution...
==> Vérification des dépendances pour la compilation...
==> Récupération des sources...
  -> Téléchargement de pytaglib-1.1.0.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 85019  100 85019    0     0  25396      0  0:00:03  0:00:03 --:--:-- 42109
==> Validation des fichiers source avec md5sums...
    pytaglib-1.1.0.tar.gz ... Réussite
==> Extraction des sources...
  -> Extraction de pytaglib-1.1.0.tar.gz avec bsdtar
==> Entre dans l’environnement fakeroot...
==> Lancement de package_python-pytaglib()...
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying src/pyprinttags.py -> build/lib.linux-x86_64-3.5
running build_ext
building 'taglib' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/taglib.cpp -o build/temp.linux-x86_64-3.5/src/taglib.o
cc1plus: attention : command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/src/taglib.o -L/usr/lib -ltag -lpython3.5m -o build/lib.linux-x86_64-3.5/taglib.cpython-35m-x86_64-linux-gnu.so
running install_lib
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib/python3.5
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib/python3.5/site-packages
copying build/lib.linux-x86_64-3.5/taglib.cpython-35m-x86_64-linux-gnu.so -> /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib/python3.5/site-packages
copying build/lib.linux-x86_64-3.5/pyprinttags.py -> /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib/python3.5/site-packages
byte-compiling /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib/python3.5/site-packages/pyprinttags.py to pyprinttags.cpython-35.pyc
writing byte-compilation script '/tmp/tmpro38hqyg.py'
/usr/bin/python -O /tmp/tmpro38hqyg.py
removing /tmp/tmpro38hqyg.py
running install_egg_info
running egg_info
writing src/pytaglib.egg-info/PKG-INFO
writing entry points to src/pytaglib.egg-info/entry_points.txt
writing top-level names to src/pytaglib.egg-info/top_level.txt
writing dependency_links to src/pytaglib.egg-info/dependency_links.txt
reading manifest file 'src/pytaglib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/pytaglib.egg-info/SOURCES.txt'
Copying src/pytaglib.egg-info to /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/lib/python3.5/site-packages/pytaglib-1.1.0-py3.5.egg-info
running install_scripts
Installing pyprinttags3 script to /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python-pytaglib/usr/bin
==> Nettoyage de l’installation...
  -> Suppression des répertoires vides...
  -> Suppression des fichiers libtool...
  -> Suppression des fichiers indésirables...
  -> Suppression des fichiers de bibliothèques statiques...
  -> Nettoyage des symboles inutiles dans les fichiers binaires et les bibliothèques...
  -> Compression des pages de man/info...
==> Recherche des erreurs d’empaquetage…
==> Création du paquet « python-pytaglib »...
  -> Génération du fichier .PKGINFO...
  -> Génération du fichier .BUILDINFO...
  -> Génération du fichier .MTREE...
  -> Compression du paquet...
==> Lancement de package_python2-pytaglib()...
running install
running build
running build_py
creating build/lib.linux-x86_64-2.7
copying src/pyprinttags.py -> build/lib.linux-x86_64-2.7
running build_ext
building 'taglib' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python2.7 -c src/taglib.cpp -o build/temp.linux-x86_64-2.7/src/taglib.o
g++ -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-2.7/src/taglib.o -L/usr/lib -ltag -lpython2.7 -o build/lib.linux-x86_64-2.7/taglib.so
running install_lib
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib/python2.7
creating /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib/python2.7/site-packages
copying build/lib.linux-x86_64-2.7/taglib.so -> /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib/python2.7/site-packages
copying build/lib.linux-x86_64-2.7/pyprinttags.py -> /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib/python2.7/site-packages
byte-compiling /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib/python2.7/site-packages/pyprinttags.py to pyprinttags.pyc
writing byte-compilation script '/tmp/tmpaqdST4.py'
/usr/bin/python2 -O /tmp/tmpaqdST4.py
removing /tmp/tmpaqdST4.py
running install_egg_info
running egg_info
writing src/pytaglib.egg-info/PKG-INFO
writing top-level names to src/pytaglib.egg-info/top_level.txt
writing dependency_links to src/pytaglib.egg-info/dependency_links.txt
writing entry points to src/pytaglib.egg-info/entry_points.txt
reading manifest file 'src/pytaglib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/pytaglib.egg-info/SOURCES.txt'
Copying src/pytaglib.egg-info to /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/lib/python2.7/site-packages/pytaglib-1.1.0-py2.7.egg-info
running install_scripts
Installing pyprinttags script to /tmp/yaourt-tmp-steph/aur-python-pytaglib/pkg/python2-pytaglib/usr/bin
==> Nettoyage de l’installation...
  -> Suppression des répertoires vides...
  -> Suppression des fichiers libtool...
  -> Suppression des fichiers indésirables...
  -> Suppression des fichiers de bibliothèques statiques...
  -> Nettoyage des symboles inutiles dans les fichiers binaires et les bibliothèques...
  -> Compression des pages de man/info...
==> Recherche des erreurs d’empaquetage…
==> Création du paquet « python2-pytaglib »...
  -> Génération du fichier .PKGINFO...
  -> Génération du fichier .BUILDINFO...
  -> Génération du fichier .MTREE...
  -> Compression du paquet...
==> Quitte l’environnement fakeroot.
==> Création finie : python-pytaglib 1.1.0-1 (dim. mars 13 19:16:37 CET 2016)
==> Nettoyage...
==> Export de python-pytaglib vers le dépôt /var/cache/pacman/pkg/
'/tmp/yaourt-tmp-steph/PKGDEST.onb/python2-pytaglib-1.1.0-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/python2-pytaglib-1.1.0-1-x86_64.pkg.tar.xz'
'/tmp/yaourt-tmp-steph/PKGDEST.onb/python-pytaglib-1.1.0-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/python-pytaglib-1.1.0-1-x86_64.pkg.tar.xz'

==> Installer python-pytaglib ? [O/n]
==> [A]fficher le contenu du paquet [V]érifier avec namcap
==> ------------------------------------------------------
==> o

chargement des paquets...
résolution des dépendances...
recherche des conflits entre paquets...

Paquets (2) python-pytaglib-1.1.0-1  python2-pytaglib-1.1.0-1

Taille totale installée :  0,15 MiB

:: Procéder à l’installation ? [O/n]
(2/2) vérification des clés dans le trousseau      [----------------------] 100%
(2/2) vérification de l’intégrité des paquets      [----------------------] 100%
(2/2) chargement des fichiers des paquets          [----------------------] 100%
(2/2) analyse des conflits entre fichiers          [----------------------] 100%
(2/2) vérification de l’espace disque disponible   [----------------------] 100%
:: Traitement des changements du paquet...
(1/2) installation de python2-pytaglib             [----------------------] 100%
(2/2) installation de python-pytaglib              [----------------------] 100%
[steph@Dell ~]$

Par contre , des dépendances de la précédente installation via pip sont restées . Faudra que j'essaye sur une autre machine. Je verrai ça ce soir.

yaate : Yet Another Audio Tag Editor

#7Messageil y a 8 ans

installation parfaite ... mais pour l'utilisation j'ai pas compris
1) le path est obligatoire , c'est pas par défaut le répertoire courant ?
2) ca me "parse" tous les types de fichiers dans mon path (.jpg) donc path n'est peut-être pas un bon nom
3) avec un path *.mp3 :pleure: il manque une gestion des erreurs (sur certains mp3)

yaate --match="%track%=1" -l ./*.mp3 
Traceback (most recent call last):
  File "/usr/bin/yaate", line 385, in <module>
    files = matchf(files, ["%artist%=.*"], mquiet=True) # little trick to remove the non-supported files
  File "/usr/bin/yaate", line 195, in matchf
    matchCmd += "\""+insensitiveRegexpFlag+re.sub("\"", "\\\"", subPathSigils(subTagSigils(match.group(3), af), path))+"\""
  File "/usr/bin/yaate", line 318, in subTagSigils
    istr = re.sub(sigil, af.tags[sigilToTag[sigil]][0], istr)
IndexError: list index out of range


4) il ne semble pas faire une recherche récursive : pas de recherche dans les sous-répertoires (important pour moi)
5) le regex :yaate --match="%track%=1" -l *.mp3 me donne ceux qui contient 1 et non ==1 , normal mais déroutant pour la simple user

6) le sortie de --match; pas de label précédent le nom de fichier donc dur à récupérer. et pour une version 2, avoir une option pour une sortie en colonne (ou pas?) avec choix des colonnes --output="FILE;ARTIST;DATE"

ps: je critique pas ! c'est une première version :clindoeil: mais mes 2 premières commandes ne me donne pas véritablement d'aller plus loin (en tant que simple utilisateur)

yaate : Yet Another Audio Tag Editor

#8Messageil y a 8 ans

1) et 2), je viens de faire quelques corrections ce qui donne :
- les warnings sont désactivés par défaut (ça évitera les messages comme quoi tel ou tel fichier n'est pas reconnu comme un fichier audio)
- si aucun chemin n'est spécifié, on prend le current working directory

3) L'erreur ne vient pas de la formulation des arguments (*.mp3), chez moi ça marche très bien. Je pense que ça doit venir d'un des fichiers que tu essaye de parser plutôt... Pourrais tu me l'envoyer que j'essaie de reproduire et corriger l'erreur ?

4) La recherche est pourtant bien récursive, et je viens de le retester. Je suis même les liens symboliques, ce que j’enlèverais peut être...

5) Malheureusement, je peux difficilement changer ça si je souhaite utiliser des regexp (ce qui est le cas). En revanche j'implémenterais une option '--fullmatch' avec une syntaxe plus proche de celle du shell (match l'ensemble du mot et utilisation des jokers * et ?)

Normalement j'ai mis une màj sur l'AUR pour les points 1) et 2).


EDIT:
Pour ce qui est du 6), l'option 'match' est juste la pour faire une restriction sur les fichiers, pas pour les lister. Mais on peut utiliser l'option 'list' ensuite pour afficher les fichiers qui respectaient l'expression régulière.

yaate : Yet Another Audio Tag Editor

#9Messageil y a 8 ans

voici le fichier pour l'erreur précédente, voici un fichier Clémentine n'affiche rien dans le champ Album.

renonmé l'extension de ce fichier pour l'ignorer et j'ai une autre erreur : mais contrairement a l'autre cette fois ci, plantage au milieu de l'affichage (plus besoin de faire des print dans le code source pour trouver le coupable :gsourire: ). Clémentine me renvoie : Album:"Untitled - 04-05-05" c'est le seul du dossier sans année comme précédent aussi.

.......
/home/Data/Patrick/Musique/rock/Arctic Monkeys/06 Arctic Monkeys - Curtains Closed.mp3
ALBUM          : Untitled - 04-05-05
ARTIST         : Arctic Monkeys
Traceback (most recent call last):
  File "/usr/bin/yaate", line 392, in <module>
    listf(matchedFiles)
  File "/usr/bin/yaate", line 172, in listf
    sprint(tag, ": "+str(af.tags[tag][0]), 15)
IndexError: list index out of range
un autre:

/home/Data/Patrick/Musique/Beatles/In the beginning/04-Take good care of my baby.mp3
GENRE          : Rock/Pop
TITLE          : Take good care of my baby
LENGTH         : 144143
ALBUM          : In the beginning
ARTIST         : The Beatles
TRACKNUMBER    : 4
Traceback (most recent call last):
  File "/usr/bin/yaate", line 395, in <module>
    listf(matchedFiles)
  File "/usr/bin/yaate", line 172, in listf
    sprint(tag, ": "+str(af.tags[tag][0]), 15)
IndexError: list index out of range




-----------------------------------



Pour uniquement la première erreur,
Avec un try except, je trouve "quelques" fichiers en erreur (sans date ou sans piste):

probleme avec: /home/Data/Patrick/Musique/divers/Best Songs Of The 80'S/David Bowie - Modern Love.mp3
...
probleme avec: /home/Data/Patrick/Musique/rock/Joan Jett/Joan Jett - I Love Rock And Roll.mp3

def matchf() ...
         for path in oldFiles:
            af = openaf(path)
            if (af):
               try:
                  insensitiveRegexpFlag=("" if caseSensitive else "(?i)")
                  # open match regexp function
                  matchCmd = "re.search("
                  # insert right part of the condition as first argument and substitute sigils
                  matchCmd += "\""+insensitiveRegexpFlag+re.sub("\"", "\\\"", subPathSigils(subTagSigils(match$
                  # insert left part of the condition as second argument and substitute sigils
                  matchCmd += ",\""+re.sub("\"", "\\\"", subPathSigils(subTagSigils(match.group(1), af), path))
                  # close function
                  matchCmd += "\")"
                  cmdReturn = eval(matchCmd)
                  if (match.group(2)=="=" and cmdReturn) or (match.group(2)=="!=" and not cmdReturn):
                     files.append(path)
                  af.close()
               except:
                  print("probleme avec:",path)
Dernière modification par papajokeil y a 8 ans, modifié au total 1 fois.

yaate : Yet Another Audio Tag Editor

#10Messageil y a 8 ans

Voilà, j'ai mis une version 1.0.3 en ligne sur l'AUR qui devrait corriger ton problème.
En tout cas, merci beaucoup pour vos retours.
Si vous avez encore des suggestions ou des problèmes, n’hésitez pas à me le dire. C'est comme ça qu'on s'améliore :D .

yaate : Yet Another Audio Tag Editor

#11Messageil y a 8 ans

:bien merci tout passe bien

un peu long a ma racine ....... et je découvre des tags :choc:

/home/Data/Patrick/Musique/rock/Avril Lavigne/Avril Lavigne - Sk8er Boi.mp3
DATE           : 2002
ALBUMARTIST    : Avril Lavigne
ARTIST         : Avril Lavigne
ALBUM          : Let Go
LABEL          : Arista
LYRICS         : He was a boy, she was a girl
Can I make it any more obvious?
He was a punk, she did ballet
What more can I say?
He wanted her, she'd never tell, secretly she wanted him as
well
But all of her friends stuck up their nose,
they had a problem with his baggy clothes.

He was a skater boy, she said see you later boy
He wasn't good enough for her
She had a pretty face, but her head was up in space
She needed to come back down to earth

5 years from now, she sits at home,
feeding the baby, she's all alone
She turns on tv, guess who she sees?
Skater boy rockin' up MTV.
She calls up her friends, they already know,
and they've all got tickets to see his show
She tags along, stands in the crowd
looks up at the man that she turned down

He was a skater boy, she said see you later boy
He wasn't good enough for her
Now he's a superstar, slammin' on his guitar
Does her pretty face see what's he's worth

He was a skater boy, she said see you later boy
He wasn't good enough for her
Now he's a superstar, slammin' on his guitar
Does her pretty face see what's he's worth

Sorry girl but you missed out
Well tough luck that boys mine now
We are more than just good friends
This is how the story ends

Too bad that you couldn't see, see the man that boy could be
There is more that meets the eye
I see the soul that is inside

He's just a boy, and I'm just a girl
Can I make it anymore obvious?

We are in love, haven't you heard, how we rock each others
world?

I'm with the skater boy, I said see you later boy
I'll be the backstage after the show
I'll be at the studio singing the song we wrote
about a girl he used to know

I'm with the skater boy, I said see you later boy
I'll be the backstage after the show
I'll be at the studio singing the song we wrote
about a girl he use to know

GENRE          : Rock
TRACKNUMBER    : 3
COMPOSER       : Avril Lavigne/Matrix
TITLE          : Sk8er Boi
COMMENT        : 


/home/Data/Patrick/Musique/punk-rock/divers/06-Demolition%20Joyride-Electric%20Frankenstein[1].mp3
DATE           : 1995
ALBUMARTIST    : Electric Frankenstein
ALBUM          : The Time Is Now!
LABEL          : Nesak
ARTISTWEBPAGE  : http://www.magnatune.com/artists/electric_frankenstein
ORIGINALARTIST : http://www.magnatune.com/artists/electric_frankenstein
TITLE          : Demolition Joyride
LENGTH         : 170000
COMMENT        : Magnatune.com
ARTIST         : Electric Frankenstein
FILEWEBPAGE    : http://www.magnatune.com/artists/electric_frankenstein
COPYRIGHT      : 2004 Electric Frankenstein - Licensed to the public under http://creativecommons.org/licenses/by-nc-sa/1.0/ verify at http://www.magnatune.com/artists/electric_frankenstein
ENCODEDBY      : http://www.magnatune.com/
COMMENT:HTTP   : //www.magnatune.com/artists/electric_frankenstein
GENRE          : Punk Rock
TRACKNUMBER    : 6
COMPOSER       : Donato Canzonieri/Electric Frankenstein/Jim Foster/Sal Canzonieri/Steve Miller


---------------------------------------------------------------------------------------
RE-EDIT

un petit décalage quand même entre ces 2 commandes yaate et yaate --match :

$ find . -iname "*.mp3" | wc -l                                       
2832
yaate | grep -E "^/.*3$" | wc -l   
2832

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PLUS que de fichiers ????????????
$yaate --match="%genre%=.*"
Matched 2851 files

$yaate | grep "^GENRE " | wc -l     
2530
$yaate --match="%genre%=^$"             
Matched 325 files


yaate -w | grep "mp3" est vide edit: c'était juste pour dire tout est clean, pas d'erreur avec un ou des fichiers qui pourrait expliquer une différence

---------------------------------------------------------------------------------------
yaate -i ne retourne rien :confus: et aussi avec -d , plus logique ?

oui j'ai très bien compris -i :clindoeil: mais yaate -i SEUL ne retourne rien, je suppose que si un parametre alors plus aucun par défaut ? comme le path ?
Dernière modification par papajokeil y a 8 ans, modifié au total 8 fois.

yaate : Yet Another Audio Tag Editor

#12Messageil y a 8 ans

L'option -i fait en sorte que les recherches de regexp soient insensibles à la casse, comme pour un grep -i.
Du coup, la commande yaate --match="%album%=w" va compter le nombre de fichiers dont le tag d'album contient au moins un 'w'.
Si tu lui rajoute l'option -i, ça comptera ceux contenant un 'w', mais aussi ceux contenant un 'W'.

De même, -d est un flag indiquant qu'il faut afficher les modifications qui auraient été réalisées, mais sans modifier les fichiers.

J'ai aussi un décalage entre les commandes find -iname "*.mp3" | wc -l et yaate | grep ".mp3$" | wc -l.
Après un peu de recherche dans un éditeur de diff j'ai trouvé que la seule différence venait des fichiers présentant une extension... en majuscule !
Chez moi l'ajout du flag -i au grep (pour donner yaate | grep -i ".mp3$" | wc -l) rétabli la balance. Tu peux vérifier chez toi ?


EDIT:
Pour ce qui est de yaate -w, c'est que je fait l’écriture des warnings sur stderr.
Je viens de mettre à jour le paquet pour changer ce comportement (les warnings sont maintenant affichés dans stdin).


EDIT2:
Ok, je vois ce que tu veux dire pour les flags type -i et -d. Je corrige ça de suite.


EDIT3:
Pour ce qui est de la différence entre yaate -lo | grep -i ".mp3$" | wc -l et yaate --match="%genre%=.*", elle n'est pas étonnante.
Si tu exécute cette commande à la place de la seconde, tu devrais avoir le même résultat : yaate --match="%genre%=.*" -lo | grep -i ".mp3$" | wc -l.
Si c'est le cas, c'est simplement dû au fait que tu dois avoir des fichiers audio dans un format qui n'est pas du mp3 (.ogg, .flac ou autre).

yaate : Yet Another Audio Tag Editor

#13Messageil y a 8 ans

désolé oui j'ai une vingtaine de fichiers ".m4a" merci les "Les Tetes Raides" :rire
Répondre