various changed and tested

This commit is contained in:
Federico Bonelli 2018-11-19 06:40:25 +08:00
parent 21420022a1
commit bc855985f0
12 changed files with 72 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

@ -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)

35
test.html Normal file
View File

@ -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&#39; Fool (03:12)</li>
</ol>
<hr />
</body>
</html>

View File

@ -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

BIN
test/03 Outside My Door.mp3 Executable file

Binary file not shown.

BIN
test/06 A Question Of Time.m4a Executable file

Binary file not shown.

BIN
test/06 Dancin' Fool.mp3 Executable file

Binary file not shown.