You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
660 B
27 lines
660 B
from datetime import datetime
|
|
import re
|
|
|
|
|
|
def timestampToDate(ts):
|
|
return datetime.fromtimestamp(int(ts)/1000000).strftime("%y-%m-%d %H:%M")
|
|
|
|
|
|
def checkStreamingVideo(link):
|
|
return re.search("^https://www.youtube.com", link) is not None or re.search("^https://player.odycdn.com", link)
|
|
|
|
|
|
def checkReddit(link):
|
|
return re.search("^https://www.reddit.com", link) is not None
|
|
|
|
|
|
def checkRedditComments(links):
|
|
for link in links:
|
|
if re.search("^https://www.reddit.com/[a-zA-Z1-9/]+/comments", link) is not None:
|
|
return link
|
|
return False
|
|
|
|
|
|
def writeLog(text):
|
|
with open("debug.log", "a") as f:
|
|
f.write(str(text))
|