-
Notifications
You must be signed in to change notification settings - Fork 0
/
tourGEN.py
456 lines (373 loc) · 36 KB
/
tourGEN.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
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
#!/usr/bin/env python3
#
# tourGEN - Tourdate Generator v0.2
# All rights reserved - (c) 2023 - suuhm
#
# ---------------------------------------
#
# Set Crontab:
#
# vi /etc/crontab
# # GET NEW TOUDATES?
# 5 6,12,16,20,23 * * * root tourgen.py -u https://... -m mail@bandsite.com >/dev/null 2>&1
#
# PIP / VIRTUALENV
# ----------------
# python -m pip install --upgrade pip
#
# apt install python-pip python3-pip python3-virtualenv
# ALT: ( pip install virualenv )
# virtualenv [--python=python3] project-XYZ
# cd project-XYZ ; source bin/activate
#
# pip list
# deactivate
# -----------------
# pip freeze [--local] > requirements.txt
# pip install -r requirements.txt
#
import argparse
import requests
from urllib.parse import urlparse
from datetime import datetime
#from bs4 import BeautifulSoup
import re
def sendmail(message, MAILADDR):
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
#
# Email configuration:
# --------------------
#
sender_email = 'tourGEN@example.com'
recipient_email = MAILADDR
subject = 'Alert'
#message = 'This is a test email alert.'
# SMTP server configuration
smtp_server = 'localhost'
smtp_port = 25
#smtp_port = 587
#smtp_username = 'your_smtp_username'
#smtp_password = 'your_smtp_password'
if args.mailsend:
recipient_email = args.mailsend
else:
recipient_email= recipient_email
# Create a MIMEText object
#msg = MIMEText(message)
msg = MIMEMultipart('alternative')
msg['Subject'] = subject
msg['From'] = sender_email
msg['To'] = recipient_email
# Record the MIME types of both parts - text/plain and text/html.
part1 = MIMEText(message, 'plain')
part2 = MIMEText(message, 'html')
# Attach parts into message container.
# According to RFC 2046, the last part of a multipart message, in this case
# the HTML message, is best and preferred.
msg.attach(part1)
msg.attach(part2)
# Send the email
try:
server = smtplib.SMTP(smtp_server, smtp_port)
server.starttls()
#server.login(smtp_username, smtp_password)
server.sendmail(sender_email, recipient_email, msg.as_string())
server.quit()
print('\n[*] Email sent successfully.')
except Exception as e:
print('\n[!!] Failed to send email:', str(e))
def set_songkick(pattern, page, trRows, aTourDates=None, COUNT=0, top3=False):
#Cleanup breakslines:
sContent = page.text.replace('\n', '').replace('\r\t', '')
sURL = "sURL"
skurl = "https://www.songkick.com"
b64img = "iV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TXftkHo90xtor8fSujXu7iT3FM5SNRPTeuO0e5JpqdfP+7p4LK1l8FckWfnE7x/KCB/OAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAu82BjwAAAHtJREFUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO3x/wFPkTveW0MgfwAAAABJRU5ErkJggg=="
if args.debug:
print("\n[*] Debug REGEXOUT: " + sContent)
if trRows != "" and top3 == True:
print("\n[!!] Setup Top 3 past shows:")
print(" -----------------------")
past_shows = r'past\".+past\-tou.+?ref..([^\"].+?)\"' #link show more
aP = re.search(past_shows, sContent)
if aP:
sURL = aP.group(1)
r = 1
else:
print("No match found for past shows.")
r = 0
elif trRows != "" and top3 == False:
URL = args.url
try:
page = requests.get(URL + "/gigography")
stat = page.raise_for_status()
print(f"\n[*] Downloaded content from {URL} and saved it to html status: {stat}")
except Exception as e:
print(f"\n[!] An error occurred: {str(e)}")
pattern = r'<li title=.+?datetime=\"([^\"]+)\".+?ref=\"(.+?)\".+?strong>(.+?)</span.*?venue-name\">(.+?)</span' # date link name room
gigo_shows = r'id=\"event-listings.*?footer-container\">'
aP = re.search(gigo_shows, page.text.replace('\n', '').replace('\r\t', ''))
r = 1
else:
#new_shows= r'upcoming\".*?@type\":\"MusicEvent\".*?url\"\:\"([^\"].+?)\".*past\"'
new_shows = r'upcoming\".*?past\"'
aP = re.search(new_shows, sContent)
r = 0
if aP:
aTourDates = re.finditer(pattern, aP.group(0))
tDates = aTourDates
# make list array
cDates = list(tDates)
lDates = len(cDates)
else:
aTourDates = None
lDates = 0
print("\n[*] Get and Show Results: (" + str(lDates) +")\n")
#if args.debug:
#print("Debug: " + str(aP))
if lDates > 0:
for dates in cDates:
if r <= 0 or top3 == True:
if args.debug:
print("\n[*] " + str(dates) + " -> " + str(dates.group(0)))
link = dates.group(3)
name = dates.group(2)
date = dates.group(6)
if date:
date = transform_date(date)
room = re.sub(r'",".+?":"', ', ', dates.group(4))
elif trRows != "" and top3 == False:
if args.debug:
print("\n[*] " + str(dates) + " -> " + str(dates.group(0)))
link = skurl + dates.group(2)
name = dates.group(3)
date = dates.group(1)
room = dates.group(4).replace('<a href="', '<a href="' + skurl)
if date:
date = transform_date(date)
#room = re.sub(r'",".+?":"', ', ', dates.group(4))
COUNT+=1
print("\n["+ str(COUNT) +".] Link " + link + " Name " + name + " Datum " + date + " Room " + room)
#trRows += "\n"
trRows += f"""<tr>
<th scope="row"><a href="{link}"><img src="data:image/png;base64,{b64img}" style="height: 42px;margin-top: -6px;" alt="View on Web"></a></th>
<td>{name}</td>
<td>{date}</td>
<td>{room}</td>
</tr>
"""
else:
trRows += f"""<tr>
<th scope="row"><a href="#"><img src="data:image/png;base64,{b64img}" style="height: 42px;margin-top: -6px;" alt="View on Web"></a></th>
<td>No</td>
<td>Shows</td>
<td>yet...</td>
</tr>
"""
if r == 1 and top3 == False:
if args.debug:
print(f"\n\n[*] Debug trRows PAST:\n ------------------ \n\n{trRows}")
return trRows.replace('sURL', sURL)
elif r == 1 and top3 == True:
if args.debug:
print(f"\n\n[*] Debug trRows PAST:\n ------------------ \n\n{trRows}")
trRows += f"""</tbody></table><br/></details><hr/>
<br/>
<h3>Past Shows - Gigography</a></h3>
</p></br>
<table class="table table-hover table-dark"><thead>
<tr>
<th scope="col">Web</th>
<th scope="col">Name?</th>
<th scope="col">Time?</th>
<th scope="col">Where?</th>
</tr>
</thead><tbody>
"""
return set_songkick(pattern, page, trRows.replace('sURL', sURL), False)
else:
if args.debug:
print(f"\n\n[*] Debug trRows NEW:\n ------------------ \n\n{trRows}")
trRows += f"""</tbody></table><br/><hr/>
<br/>
<details class="spoiler-details animated">
<summary class="buybtn" style="color: rgb(255, 255, 255); border-style: dotted none; --darkreader-inline-color: #fffff8;" data-darkreader-inline-color="">Show last 3 Shows</summary>
<h3>Past Shows - <a href="{skurl + sURL}">Show all past shows</a></h3>
</p></br>
<table class="table table-hover table-dark"><thead>
<tr>
<th scope="col">Web</th>
<th scope="col">Name?</th>
<th scope="col">Time?</th>
<th scope="col">Where?</th>
</tr>
</thead><tbody>
"""
return set_songkick(pattern, page, trRows, None, 0, True)
def set_spotify(mode, pattern, page, trRows="", aTourDates=None, COUNT=0):
b64img = "iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d15uF1lYS7wd5/MTElOQpgCYQYlqECLolgFbxlkJoYqjvXptXXubav2Vm25zkN7r+OtVr1a1FYNoCiOFRBkEhwAAQEZIpQhJGSGhJBz9v1jkxpChjPss7+19v79nmc9GThnr5eTdc737m+t9a0EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACA7tQoHWAYxifZNcn2SXZIMu2JXyeWDAU9bl2S1UmWP/Hr6iSLkqwvGYokyaQkBybZJcn0wlm6Va2P/6oWgAOSHJ3k4LQO4IOT7JdkQslQwJCsS3JXkluT3PbEr1ckuaNkqB4xO8nLk5yS5Mj4mVlC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bPZyb5elr3KzZtNputg9tAWguYdYsJSX6Q8l9XW3uP0a8leUa62MFpnR5YnvJfcJvN1v3bqiSnp/tMSOv5LKW/vrbRbcuTfDbJQemwklPyU9KajntlkuOSjC+YBehOt6R1DvXXpYOModeldU/41NJBGLL1ac3gfCXJhWkt9NRxVTknPyutEnDsE9ucsnGAmnsgrUHx0+mSc6jbMDPJO5O8IZ4cWFULk1zyxPajJIuLpkl1CsCm9k1ydJKnpXXx4MFJ9o8DG9iyh9P64bogrYuoHisbp4jdk5yd5NS07sDyM7Pz1iX5bVp3w92e1jMnrkhyV8lQm1PVArA549KaKdghyU5pTXftkHo90xtor8fSujXu7iT3FM5SNRPTeuO0e5JpqdfP+7p4LK1l8FckWfnE7x/KCB/OAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAu82BjwAAAHtJREFUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO3x/wFPkTveW0MgfwAAAABJRU5ErkJggg=="
if "spotify.com" in mode:
#Cleanup breakslines:
sContent = page.text.replace('\n', '').replace('\r\t', '')
aTourDates = re.finditer(pattern, page.text)
tDates = aTourDates
# make list array
cDates = list(tDates)
lDates = len(cDates)
print("\n[*] Get and Show Results: (" + str(lDates) +")\n")
if args.debug:
print("Debug: " + page.text + " - " + str(list(aTourDates)))
if lDates > 0:
for dates in cDates:
if "spotify.com" in mode:
link = dates.group(1)
name = dates.group(2)
date = dates.group(3)
if date:
date = transform_date(date)
room = dates.group(4)
elif "other.com" in mode:
link = dates.group(1)
name = dates.group(3)
date = dates.group(4)
if date:
date = transform_date(date)
room = dates.group(2)
COUNT+=1
print("["+ str(COUNT) +".] Link " + link + " Name " + name + " Datum " + date + " Room " + room)
#trRows += "\n"
trRows += f"""<tr>
<th scope="row"><a href="{link}"><img src="data:image/png;base64,{b64img}" style="height: 42px;margin-top: -6px;" alt="View on Web"></a></th>
<td>{name}</td>
<td>{date}</td>
<td>{room}</td>
</tr>
"""
else:
trRows += f"""<tr>
<th scope="row"><a href="#"><img src="data:image/png;base64,{b64img}" style="height: 42px;margin-top: -6px;" alt="View on Web"></a></th>
<td>No</td>
<td>Shows</td>
<td>yet...</td>
</tr>
"""
return trRows
def write_to_tourhtml(HTMFILE, trRows):
# Create an HTML template string with placeholders
html_template = f"""
<link rel="stylesheet" href="/css/cwe-strap-cont.css">
<style>.table th, .table td {{padding: 0.55rem;}}</style>
<h1>TOUR/SHOWS</h1>
<br/>
<!--
<h3>No Shows at the moment</h3>
-->
<br/><br/>
<table class="table table-hover table-dark">
<thead>
<tr>
<th scope="col">Web</th>
<th scope="col">Name?</th>
<th scope="col">Time?</th>
<th scope="col">Where?</th>
</tr>
</thead>
<tbody>
{trRows}
</tbody>
</table>
<p><br/><br/><br/><br/></p>
"""
try:
print(f"\n[*] Write html-TEXT to {HTMFILE} ...")
#formatted_html = html_template.format(title, title, content)
with open(HTMFILE, 'wt') as file:
file.write(html_template + "\n")
#DEBUG:
#print(html_template)
except Exception as e:
print(f"\n[!] An error occurred: {str(e)}")
def transform_date(date_string):
try:
# Parse with timezone information if available
date_object = datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S%z")
except ValueError:
try:
# Try without timezone information
date_object = datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S")
except ValueError:
# Fallback to date-only format
date_object = datetime.strptime(date_string, "%Y-%m-%d")
# Format the datetime object into the desired output format
formatted_date = date_object.strftime("%d.%m.%Y Doors: %I:%M %p")
return formatted_date
def main():
print(" ----------------------------------------- ")
print(" | tourGEN - Tourdate Generator v0.2 |")
print(" | by suuhm (C) 2023 |")
print(" --------------------------------------- \n")
# VARS
#
URL = "https://open.spotify.com/artist/629ruWM6oJTLI5gODFYrwh/concerts"
HTMFILE = "/var/www/tour.html"
MAILADDR = "" # info@bandsite.local
aTourDates = None
trRows = ""
# SUBPRCESS
#
# cmd = f"sd.py {args.filename} ..."
# result subprocess.run(cmd, shell=True, captured_output=True, text=True)
# lines = result.stdout.split("\n")
# ARGS PARSER:
parser = argparse.ArgumentParser(description='Download content from a URL and save it to a file.')
parser.add_argument("--url", "-u", default=URL, required=False, help="URL to fetch data from")
parser.add_argument("--export", "-f", default=HTMFILE, required=False, help="Name of the HTML file to save the data")
parser.add_argument("--debug", "-d", default=None, action="store_true", required=False, help="Output debugging of site conntent")
parser.add_argument("--mailsend", "-m", default=MAILADDR, required=False, help="Get a debugging mail")
# PCHECK ARGS:
global args
args = parser.parse_args()
if args.url:
URL = args.url
else:
URL = URL
if args.export:
HTMFILE = args.export
else:
HTMFILE = HTMFILE
# Perform the download and save operation
try:
page = requests.get(URL)
stat = page.raise_for_status()
print(f"\n[*] Downloaded content from {URL} and saved it to {HTMFILE} status: {stat}")
# DEBUGGING:
if args.debug:
print(f"\n\n[*] Debug:\n ------------------ \n\n{stat}")
except Exception as e:
print(f"\n[!] An error occurred: {str(e)}")
# GET CONTENT PER REGEX
#
# GET DOMAIN TO CHECK:
parsed_url = urlparse(URL)
domain = parsed_url.netloc
if "spotify.com" in domain:
print(f"\n[+] Using Regex scraping of '{domain}' ...")
pattern = r'{\"@type\":\"MusicEven.*?\"\:\"([^\"]+).+?\:\"([^\"]+).+?\:\"([^\"]+).+?ad.*?ty.\:\"([^\"]+)' #link , name, date, room
trRows = set_spotify(domain, pattern, page, trRows)
elif "songkick.com" in domain:
print(f"\n[+] Using Regex scraping of '{domain}' ...")
pattern = r'mary-det.+?\>(.+?)\<.+?ail\"\>(.+?)\<.+?url\"\:\"([^\?]+).+?ad.+?ality\"\:\"([^\}].+?)\"\}.+?name\"\:\"([^\"]+).+?s.+?ate\"\:\"([^\"]+)' #room, name, link, room-adv, location, date
trRows = set_songkick(pattern, page, trRows)
else:
print(f"\n[!] Cannot find domain {domain}...")
pattern = r'{.*\"\:\"([^\"]+).+?\:\"([^\"]+).+?\:\"([^\"]+).*?ty.\:\"([^\"]+)'
# DEBUGGING:
if args.debug:
print(f"\n\n[*] Debug trRows MAIN:\n ------------------ \n\n{trRows}")
write_to_tourhtml(HTMFILE, trRows)
if args.mailsend:
# Get MAIL?
sendmail(trRows, MAILADDR)
if __name__ == "__main__":
main()