another version

This commit is contained in:
Federico Bonelli 2018-10-18 16:55:21 +02:00
parent c0f32ee3d9
commit 21420022a1
4 changed files with 78 additions and 8 deletions

37
Playlist.m3u Normal file
View File

@ -0,0 +1,37 @@
#EXTM3U
#EXTINF:274,Black Sabbath - Planet Caravan
file:///Volumes/music/Black%20Sabbath/Paranoid/03%20Planet%20Caravan.mp3
#EXTINF:267,Hector Zazou - An Realt (The Star)
file:///Volumes/music/Hector%20Zazou/Lights%20In%20the%20Dark/1-01%20An%20Realt%20%28The%20Star%29.mp3
#EXTINF:447,Popol Vuh - Nascita Dell' Ape
file:///Volumes/music/Popol%20Vuh%20Discography/%281999%29%20Popol%20Vuh%20-%20Messa%20Di%20Orfeo%20%5B192%20kbps%5D/03%20-%20Nascita%20Dell%27%20Ape.mp3
#EXTINF:212,Can - Vitamin C
file:///Volumes/music/Can/Ege%20Bamyasi/04%20Vitamin%20C.mp3
#EXTINF:263,Depeche Mode - A Question Of Lust
file:///Volumes/music/Black%20Celebration/03%20A%20Question%20Of%20Lust.m4a
#EXTINF:228,Can - Soul Desert (from Madchen Mit Gewalt)
file:///Volumes/music/Can/Soundtracks/05%20Soul%20Desert%20%28from%20Madchen%20Mit%20Gewalt%29.mp3
#EXTINF:270,CCCP fedeli alla linea CCCP fedeli alla linea - Curami
file:///Volumes/music/CCCP%20Fedeli%20alla%20Linea%20-%20Affinita%27%20-%20Divergenze%20fra%20il%20Compagno%20Togliatti%20e%20Noi%20%281986%29%20%5BFLAC%5D/02%20-%20Curami.flac
#EXTINF:118,Holy Modal Rounders - Mister Spaceman
file:///Volumes/music/Holy%20Modal%20Rounders/Holy%20Modal%20Rounders%201%20%26%202/09%20Mister%20Spaceman.mp3
#EXTINF:230,John Lennon - Working Class Hero
file:///Volumes/music/John%20Lennon/John%20Lennon_Plastic%20Ono%20Band/04%20Working%20Class%20Hero.mp3
#EXTINF:218,Johnny Cash - Hurt
file:///Volumes/music/Johnny%20Cash.American%20IV%20The%20man%20comes%20around%202002/American%20IV-%20The%20Man%20Comes%20Around/02%20Hurt.mp3
#EXTINF:132,Kudsi Erguner - Gul Yuzunu (Ilahi In Maqam Huzzam
file:///Volumes/music/Kudsi%20Erguner/Musique%20de%20tekke%20d%27Istanul%20%28La%20Fontaine%20de%20la%20Se%CC%81paration%29/13%20Gul%20Yuzunu%20%28Ilahi%20In%20Maqam%20Huzzam.m4a
#EXTINF:513,Led Zeppelin - Kashmir
file:///Volumes/music/Led%20Zeppelin/Physical%20Graffiti/Led%20Zeppelin%20-%20Kashmir.mp3
#EXTINF:284,Neil Young - Like a Hurricane
file:///Volumes/music/Neil%20Young/Unplugged/14%20Like%20a%20Hurricane.mp3
#EXTINF:358,Neil Young - Look Out for My Love
file:///Volumes/music/Neil%20Young/Unplugged/14%20Look%20Out%20for%20My%20Love.mp3
#EXTINF:585,memmuziekgebouwmp3
file:///Volumes/music/occult%20music/Tarot/Florian%20Magnus%20Maier%20-%20Mem%20%28The%20Hanged%20Man%29.mp3
#EXTINF:342,Pansequito con la Guitarra de Tomatito - Si esta Gitana Quisiera (Soleá Flamenco)
file:///Volumes/music/Pansequito%20con%20la%20Guitarra%20de%20Tomatito/Flamenco%20Suenan%20Las%20Campanas/08%20Si%20esta%20Gitana%20Quisiera%20%28Solea%CC%81%20Flamenco%29.m4a
#EXTINF:165,Popol Vuh - Deep in the Ocean of Love
file:///Volumes/music/Popol%20Vuh%20Discography/%281999%29%20Popol%20Vuh%20-%20Messa%20Di%20Orfeo%20%5B192%20kbps%5D/01%20-%20Deep%20in%20the%20Ocean%20of%20Love.mp3
#EXTINF:401,Son House - Walking Blues
file:///Volumes/music/Son%20House%20-%20Martin%20Scorsese%20Presents%20The%20Blues%20-%20Son%20House%20%282003%29%20%5BFLAC%5D/05%20-%20Walking%20Blues.flac

32
stalista.py Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env python3
from argparse import ArgumentParser
from os import makedirs
from shutil import copy
import urllib.parse
def main():
parser = ArgumentParser()
parser.add_argument('playlist')
parser.add_argument('directory')
args = parser.parse_args()
makedirs(args.directory, exist_ok=True)
with open(args.playlist) as file:
data = file.read().splitlines()
files = []
for i in data:
if i.startswith('file://'):
files.append("'" + urllib.parse.unquote(i)[7:] + "'")
#files.append(urllib.parse.unquote(i)[7:])
for j in files:
copy(j, args.directory)
if __name__ == '__main__':
main()

View File

@ -18,7 +18,8 @@ directory="$2"
mkdir -p "$directory"
files="$(grep 'file://' "$playlist")"
echo $files
for i in $files; do
cp -v "$(echo "$i" | cut -c 8-)" "$directory/"
cp -v "$(echo "$i" | cut -c 8- -)" "$directory/"
# "echo "$i" | cut -c 8-" deletes file://
done

View File

@ -1,7 +1,7 @@
#EXTM3U
#EXTINF:258,Kontroll Csoport - Kis piros bombázó
file:///Volumes/music/1983%201_2%20CD/04%20Kis%20piros%20bomba%CC%81zo%CC%81.mp3
#EXTINF:375,Amon Düül II - Yeti Talks to Yogi (Improvisation)
file:///Volumes/music/amon%20dull%202%20-%20yeti/Amon%20Du%CC%88u%CC%88l%20II%20-%20Yeti%20%5BGermany%20Bonus%20Tracks%5D%20-%2009%20-%20Yeti%20Talks%20to%20Yogi%20%28Improvisation%29.flac
#EXTINF:173,Black Sabbath - Paranoid
file:///Volumes/music/Black%20Sabbath/Paranoid/02%20Paranoid.mp3
#EXTINF:251,Can - Outside My Door
mp3-origin/03%20Outside%20My%20Door.mp3
#EXTINF:249,Depeche Mode - A Question Of Time
mp3-origin/06%20A%20Question%20Of%20Time.m4a
#EXTINF:192,Frank Zappa - Dancin' Fool
mp3-origin/06%20Dancin%27%20Fool.mp3