-
Notifications
You must be signed in to change notification settings - Fork 9
/
Audible.com#Search by Album.src
335 lines (295 loc) · 6.5 KB
/
Audible.com#Search by Album.src
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# ###################################################################
# Mp3tag parsing for Audible.com.
# Initially created by dano on 2013-03-11
# After 11.04.2020, improved by romano, changes in the commits: https://github.com/romanoh/Mp3tag-Repository
# 22.12.2021: Fix a rare error in series name appearing as "Audible Original Stories"
# 03.12.2022: Fix a small html error.
#
#
# This file should be in your sources dir.
# On Windows XP it's C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
# ####################################################################
[Name]=Audible.com [v.03.12.2022]
[BasedOn]=www.audible.com
[IndexUrl]=https://www.audible.com/search?keywords=
[AlbumUrl]=https://www.audible.com
[WordSeparator]=+
[IndexFormat]=%_url%|% ↓ Album%|% ↓ Author%|% ↓ Duration%|% ↓ Year%|% ↓ Language%
[SearchBy]=Enter Artist and/or Album||%artist% $regexp(%album%,'[- ]+cd ?\d+$',,1)||%s
[Encoding]=url-utf-8
[ParserScriptIndex]=...
# ###################################################################
# I N D E X
# ###################################################################
#DebugWriteInput "C:\Users\xxxx\Desktop\mp3tag.html"
#Debug "ON" "C:\Users\xxxxx\Desktop\mp3tagdebug.txt"
#Only select the area we need instead of everyting.
findline "center-3"
joinuntil "center-4"
#Matches any whitespace character (spaces, tabs, line breaks).
regexpreplace "\s\s+" " "
#Matches a TAB character
regexpreplace "\t+" " "
replace "\" >" "\">"
replace "> <" "><"
replace "Running Time:" ""
findinline "results"
findinline "<h3 class=\"bc-heading"
#this \" is iqual to "
do
# Url
findinline "href=\""
sayuntil "\""
say "|"
# Album
findinline ">"
sayuntil "<"
findinline "</li>"
if "<li class=\"bc-list-item subtitle"
say " - "
findinline "bc-color-secondary\">"
sayuntil "<"
else
if "<li class=\"bc-list-item bc"
say " - "
findinline ">"
sayuntil "<"
endif
endif
say "|"
#Author
findinline "authorLabel\">"
findinline "href="
findinline ">"
sayuntil "<"
say "|"
#Series
#findinline "Series:" 1 1
#findinline "href=\"/series/" 1 1
#findinline "\">" 1 1
#sayuntil "<"
#findinline "Book " 1 1
#say " "
#saynextnumber
#say "|"
# Duration
findinline "runtimeLabel\">"
findinline "Length: "
sayuntil "<"
say "|"
# Year
findinline "Release date:"
sayuntil "<"
say "|"
# Language
findinline "languageLabel\">"
findinline "Language:"
sayuntil "<"
saynewline
findinline "<h3 class=\"bc-heading " 1 1
while "bc-color-link" 99
[ParserScriptAlbum]=...
# ###################################################################
# A L B U M
# ###################################################################
#DebugWriteInput "C:\Users\xxxxx\Desktop\mp3tag.html"
#Debug "ON" "C:\Users\egual\Desktop\mp3tagdebug.txt"
# Asin
findline "<input type=\"hidden\" name=\"asin\" value=\""
findinline "<input type=\"hidden\" name=\"asin\" value=\""
outputto "Asin"
sayuntil "\""
gotoline 1
# Album
findline "<h1 class=\"bc-heading"
joinuntil "authorLabel"
findinline ">"
findinline ":" 1 1
movechar -1
if ":"
findline "<h1 class=\"bc-heading"
joinuntil "authorLabel"
findinline ">"
outputto "Album"
regexpreplace "</?[^><]+>" ""
unspace
regexpreplace " +" " "
sayuntil ":"
outputto "subtitle"
movechar 2
sayuntil "<"
else
findline "<h1 class=\"bc-heading"
joinuntil "authorLabel"
findinline ">" 1 1
outputto "Album"
sayuntil "<"
endif
# Subtitle of Album
regexpreplace " +" " "
replace "<span class=\"bc-text bc-size-medium\" ></span>" ""
findinline "bc-text bc-size-medium\" " 1 1
if ">"
movechar 1
outputto "Subtitle"
sayuntil "<"
else
gotoline 1
endif
# Author
outputto "Artist"
findline "authorLabel"
moveline 3 1
joinuntil "</li>"
regexpreplace "</?[^><]+>" ""
unspace
regexpreplace " +" " "
regexpreplace ".+By:" ""
sayrest
# narratorLabel
outputto "Composer"
findline "narratorLabel"
moveline 3 1
joinuntil "</li>"
regexpreplace "</?[^><]+>" ""
unspace
#join more than one space
regexpreplace " +" " "
replace "Narrated by: " ""
sayrest
# Grouping / Series
findline "seriesLabel" 1 1
unspace
if "seriesLabel"
outputto "SERIES"
findline "href="
findinline ">"
if "Audible Original Stories"
sayoutput ""
else
sayuntil "<"
outputto "series-part"
findinline "a>, Book " 1 1
SayRegexp "^[.?\d]+$"
endif
else
gotoline 1
endif
# 1st Genre
findline "categoriesLabel" 1 1
unspace
if "categoriesLabel"
outputto "tmp_Genre1"
findinline "categoriesLabel" 1 1
joinuntil "</li>"
findinline "href="
findinline ">"
sayuntil "<"
# 2nd Genre
findinline "href=" 1 1
movechar -1
if "="
findinline ">"
outputto "tmp_Genre2"
sayuntil "<"
outputto "genre"
sayoutput "tmp_Genre1"
say "/"
sayoutput "tmp_Genre2"
else
outputto "genre"
sayoutput "tmp_Genre1"
endif
else
gotoline 1
endif
# Rating
outputto "RATING WINAMP"
findline "ratingsLabel" 1 1
unspace
if "ratingsLabel"
findline "bc-pub-offscreen"
findinline ">"
saynextnumber
else
gotoline 1
endif
# Description
findline "Publisher's Summary"
outputto "Comment"
findline "<span class"
joinuntil "</span>"
regexpreplace "</?[^><]+>" ""
unspace
regexpreplace " +" " "
replace "bc-color-secondary\" >" ""
sayrest
# © Year, ©, Release Year, Publisher, the closest we can get to Original Pub year, Audible is not consistent with dates
findline "</div>"
joinuntil "</span>"
findinline "(P)" 1 1
movechar -17
if "Public Domain"
outputto "Copyright"
say "Public Domain"
outputto "year"
findinline "(P)"
SayNChars 4
outputto "Publisher"
movechar 1
sayuntil "<"
else
gotoline 1
findline "©"
findinline "©"
outputto "Year"
SayNChars 4
gotoline 1
findline "©"
replace "(P)" "; "
findinline "©"
outputto "Copyright"
sayuntil ";"
movechar 2
outputto "RELEASETIME"
SayNChars 4
outputto "Publisher"
movechar 1
sayuntil "<"
endif
# Cover
outputto "Coverurl"
findline "\"image\": \""
replace "_SL175_" "_SS500_"
replace "_SL300_" "_SS500_"
findinline "\"image\": \""
sayuntil "\""
# Set "Albumsort"
IfOutput "series"
outputto "Albumsort"
sayoutput "series"
say " "
sayoutput "series-part"
say " "
say "- "
sayoutput "Year"
say ". "
sayoutput "album"
else
outputto "Albumsort"
sayoutput "Year"
say ". "
sayoutput "album"
endif
# Set Artist = Albumartist
outputto "albumartist"
sayoutput "Artist"
# Set Disknumber
outputto "DISCNUMBER"
sayoutput "series-part"
# Set Audible Album URL
outputto "WWWAUDIOFILE"
sayoutput "CurrentUrl"
# Set Comment to DESCRIPTION for better MP4 support
outputto "DESCRIPTION"
sayoutput "Comment"