various changed and tested
This commit is contained in:
parent
21420022a1
commit
bc855985f0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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()
|
|
@ -21,8 +21,8 @@ def main():
|
|||
files = []
|
||||
for i in data:
|
||||
if i.startswith('file://'):
|
||||
files.append("'" + urllib.parse.unquote(i)[7:] + "'")
|
||||
#files.append(urllib.parse.unquote(i)[7:])
|
||||
#files.append("'" + urllib.parse.unquote(i)[7:] + "'")
|
||||
files.append(urllib.parse.unquote(i)[7:])
|
||||
|
||||
for j in files:
|
||||
copy(j, args.directory)
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="Generator" content="VLC media player" />
|
||||
<meta name="Author" content="VLC, http://www.videolan.org/vlc/" />
|
||||
<title>VLC generated playlist</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: #E4F3FF;
|
||||
font-family: sans-serif, Helvetica, Arial;
|
||||
font-size: 13px;
|
||||
}
|
||||
h1 {
|
||||
color: #2D58AE;
|
||||
font-size: 25px;
|
||||
}
|
||||
hr {
|
||||
color: #555555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Playlist</h1>
|
||||
<hr />
|
||||
<ol>
|
||||
<li>Can - Outside My Door (04:11)</li>
|
||||
<li>Depeche Mode - A Question Of Time (04:09)</li>
|
||||
<li>Frank Zappa - Dancin' Fool (03:12)</li>
|
||||
</ol>
|
||||
<hr />
|
||||
</body>
|
||||
</html>
|
6
test.m3u
6
test.m3u
|
@ -1,7 +1,7 @@
|
|||
#EXTM3U
|
||||
#EXTINF:251,Can - Outside My Door
|
||||
mp3-origin/03%20Outside%20My%20Door.mp3
|
||||
file:///Users/fredd/devel/stalista2/mp3-origin/03%20Outside%20My%20Door.mp3
|
||||
#EXTINF:249,Depeche Mode - A Question Of Time
|
||||
mp3-origin/06%20A%20Question%20Of%20Time.m4a
|
||||
file:///Users/fredd/devel/stalista2/mp3-origin/06%20A%20Question%20Of%20Time.m4a
|
||||
#EXTINF:192,Frank Zappa - Dancin' Fool
|
||||
mp3-origin/06%20Dancin%27%20Fool.mp3
|
||||
file:///Users/fredd/devel/stalista2/mp3-origin/06%20Dancin%27%20Fool.mp3
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue