Skip to content

Instantly share code, notes, and snippets.

@piyh
Last active September 4, 2020 19:59
Show Gist options
  • Save piyh/2c62dc1b2b6087d5fe48ecf1a147e661 to your computer and use it in GitHub Desktop.
Save piyh/2c62dc1b2b6087d5fe48ecf1a147e661 to your computer and use it in GitHub Desktop.
from datetime import datetime
timestampDelimiter = '|'
url = 'https://www.youtube.com/watch?v=KUCkrZKslr4'
summary ='''0:00| Welcomes Nikki
0:03| Standup comedy during covid
2:55| Speculation about the closure of comedy clubs
3:20| NY during covid & its demise
5:03| NY rental rates
6:10| Apocalyptic disasters & the pandemic
7:26| Aliens & primates
9:18| The Somali sengi
11:20| Why humans are humans different?
13:30| Humans, dogs & hybrids
17:12| Tall people bulldogs & vitamin D
20:18| Getting tested for covid
21:00| Covid, Texas, vitamin D & supplements
24:40| Nikki is quitting weed & depression
29:10| Masks, sunlight, protests & respirators
37:00| Working during covid & Joe quit writing a book
38:30| Standup talk & dating
43:10| Fame & dating
46:20| Flirting on a flight, masks & face shields
52:42| Nikki talks about relationships & getting laid 59:59| Dating apps & addictions
1:04:50| Sexting, addicts & Amy Winehouse
1:14:08| Orgasms & Nikkis porn choices
1:19:44| Consensual non consent & vibrators
1:25:28| Being criticized & old porn
1:28:16| Choking & the Golden State Killer
1:29:28| Dopamine & addiction
1:33:01| Antidepressants, ADHD & exercise
1:36:00| Ketamine therapy & Bert Kreischer
1:39:03| Joes mental health & working out
1:40:52| Game addiction & drinking
1:43:03| Joe talks about being a savage
1:44:25| Standup, covid talk & Micheal Yo
1:48:11| Sleep, phone addiction, books & saunas
1:50:07| Joes game addiction, hiking & bag work
1:54:13| Crying, weakness & feeling sorry for yourself
2:02:07| Pity, bad childhoods & depression
2:07:06| The porn industry, Doctor Drew & Nikkis kinks
2:21:34| Nikki on being 'a lot' & being enough
2:23:35| Nikkis intensity & finding a husband
2:25:20| Ellen, censorship & the ocean of ideas'''
summary = summary.split('\n')
summary = [x for x in summary if x != '']
for x in summary:
hms = []
idx = x.find(timestampDelimiter)
descr = x[idx+1:]
ts = x[:idx]
hmsEntry = ''
for cnt, char in enumerate(ts):
if char == ':':
hms.append(hmsEntry)
hmsEntry = ''
else:
hmsEntry = hmsEntry + char
if cnt+1 == len(ts):
hms.append(hmsEntry)
hmsEntry = ''
# print(cnt, ts, char)
# print(ts, descr, hmsEntry)
if len(hms) not in (2,3):
print(x)
continue
if len(hms) == 2 :
tsUrl = url + f'&t={hms[0]}m{hms[1]}s'
if len(hms) == 3:
tsUrl = url + f'&t={hms[0]}h{hms[1]}m{hms[2]}s'
print(f'[{ts}]({tsUrl}) - {descr}\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment