-
Notifications
You must be signed in to change notification settings - Fork 0
/
squash-ampache6.py
106 lines (94 loc) · 7.04 KB
/
squash-ampache6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env python3
import codecs
import os
import re
def self_check(folder, find, replace):
if os.path.isfile(folder):
print("Reading " + folder)
f = codecs.open(folder, 'r', encoding="utf-8")
filedata = f.read()
f.close()
newdata = re.sub(find, replace, filedata)
f = codecs.open(folder, 'w', encoding="utf-8")
f.write(newdata)
f.close()
elif os.path.isdir(folder):
print("DIR " + folder)
for files in os.listdir(folder):
filename = os.path.join(folder, files)
if os.path.isdir(filename):
self_check(filename, find, replace)
elif os.path.isfile(filename):
extension = os.path.splitext(filename)[-1]
if extension == ".php" or extension == ".json" or extension == ".sh":
print("Reading " + extension + ": " + filename)
f = codecs.open(filename, 'r', encoding="utf-8")
filedata = f.read()
f.close()
newdata = re.sub(find, replace, filedata)
f = codecs.open(filename, 'w', encoding="utf-8")
f.write(newdata)
f.close()
self_check("./ampache-squashed6/lib/javascript/search-data.php", "\$dic = require __DIR__ \. '/\.\./\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../../src/Config/Init.php';")
self_check("./ampache-squashed6/src", "/public/", "/")
self_check("./ampache-squashed6/templates", "/public/", "/")
self_check("./ampache-squashed6/templates", "/\.\./\.\./", "/../")
self_check("./ampache-squashed6/albums.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/logout.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/show_get.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/artists.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/lostpassword.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/smartplaylist.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/arts.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/mashup.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/song.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/batch.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/now_playing.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/stats.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/broadcast.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/phpinfo.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/stream.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/browse.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/playlist.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/test.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/channel.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/podcast_episode.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/tvshow_seasons.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/cookie_disclaimer.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/podcast.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/tvshows.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/democratic.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/preferences.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/update.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/error.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/pvmsg.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/upload.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/graph.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/radio.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/util.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/image.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/random.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/video.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/index.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/register.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/waveform.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/install.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/rss.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/web_player_embedded.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/labels.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/search.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/web_player.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/localplay.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/share.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/login.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/shout.php", "__DIR__ \. '/\.\./", "__DIR__ . '/")
self_check("./ampache-squashed6/composer.json", "public/lib", "lib")
self_check("./ampache-squashed6/locale/base/gather-messages.sh", "public/lib", "lib")
self_check("./ampache-squashed6/admin", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/captcha", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/daap", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/play", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/rest", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/server", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/upnp", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")
self_check("./ampache-squashed6/webdav", "\$dic = require __DIR__ \. '/\.\./\.\./src/Config/Init\.php';", "$dic = require __DIR__ . '/../src/Config/Init.php';")