-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathitunes.src
More file actions
130 lines (100 loc) · 3.21 KB
/
itunes.src
File metadata and controls
130 lines (100 loc) · 3.21 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
########################################################
# iTunes Web Sources Script for Mp3Tag #
# #
#version 1.2 #
#created by pone in May 2012 #
#modified by bigfuji in Nov 2016 #
########################################################
########################################################
# SEARCH BY DIALOG #
########################################################
[Name]=iTunes
[BasedOn]=http://itunes.apple.com
[IndexUrl]=http://itunes.apple.com/search?term=%s&entity=album&limit=100
[AlbumUrl]=http://itunes.apple.com/lookup?id=
[WordSeperator]=+
[IndexFormat]=%_preview%|%_url%|%Artist%|%Album%|%Tracks%|%Type%|%Copyright%|
[SearchBy]=%artist% %album%
[Encoding]=url-utf-8
########################################################
# LIST OF SEARCH RESULTS DIALOG #
########################################################
[ParserScriptIndex]=...
debug "on" "d:\debug_itunes_A.html"
findline "wrapperType\""
do
joinuntil "}"
replace "\\\"" "\""
replace "?uo=4" ""
# PREVIEW
sayregexp "(?<=\"collectionViewUrl\":\").+?(?=\")" ", " "}"
say "|"
# URL
sayregexp "(?<=\"collectionId\":)\d+?(?=,)" ", " "}"
say "&entity=song&limit=200"
say "|"
# ARTIST
sayregexp "(?<=\"artistName\":\")[^\"]{1,75}(?=.)" ", " "}"
say "|"
# ALBUM
sayregexp "(?<=\"collectionName\":\").+?(?=\")" ", " "}"
say "|"
# TRACKS
sayregexp "(?<=\"trackCount\":)\d+?(?=,)" ", " "}"
say "|"
# TYPE
sayregexp "(?<=\"collectionType\":\").+?(?=\")" ", " "}"
say "|"
# COPYRIGHT
sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"
say "|"
saynewline
findline "wrapperType\"" 2 1
while "{\"wrapperType" 201
########################################################
# ADJUST TAG INFORMATION DIALOG #
########################################################
[ParserScriptAlbum]=...
debug "on" "d:\debug_itunes_B.html" "10"
findline "wrapperType\""
joinuntil "}"
outputto "COVERURL"
sayregexp "(?<=\"artworkUrl100\":\").+?(?=\")" ", " "}"
outputto "ALBUMARTIST"
sayregexp "(?<=\"artistName\":\").+?(?=\")" ", " "}"
outputto "ALBUM"
sayregexp "(?<=\"collectionName\":\").+?(?=\")" ", " "}"
outputto "YEAR"
sayregexp "(?<=\"copyright\":\")\d\d\d\d(?=.)" ", " "}"
regexpreplace "(\d\d\d\d),?" "<<<year$1>>>"
findinline "\"copyright\":\"" 1 1
ifnot "<<<year"
gotochar 1
sayregexp "(?<=\"releaseDate\":\"<<<year)\d\d\d\d(?=>>>)" ", " "}"
else
gotochar 1
endif
outputto "PUBLISHER"
regexpreplace "<<<year\d*>>>" ""
regexpreplace " +" " "
sayregexp "(?<=\"copyright\":\").+?(?=\")" ", " "}"
# TRACK LOOP
findline "wrapperType\"" 2 1
do
joinuntil "}"
replace "\\\"" "\""
outputto "TRACKS"
sayregexp "(?<=\"trackCensoredName\":\").+?(?=\")" ", " "}"
#sayregexp "(?<=\"trackName\":\").+?(?=\")" ", " "}"
say "|"
outputto "ARTIST"
sayregexp "(?<=\"artistName\":\").+?(?=\")" ", " "}"
say "|"
outputto "GENRE"
sayregexp "(?<=\"primaryGenreName\":\").+?(?=\")" ", " "}"
say "|"
outputto "_LENGTH"
sayregexp "(?<=\"trackTimeMillis\":)\d+?(?=\D)" ", " "}"
say "|"
findline "wrapperType\"" 2 1
while "{\"wrapperType"