MCPcopy
hub / github.com/hellerve/programming-talks / get_release_year

Function get_release_year

scripts/add_years.py:31–45  ·  view source on GitHub ↗
(link)

Source from the content-addressed store, hash-verified

29
30
31def get_release_year(link):
32 try:
33 response = check_output(['youtube-dl',
34 link,
35 '--skip-download',
36 '--get-filename',
37 '-o "%(release_date)s|%(upload_date)s"']
38 ).decode('utf-8').strip()
39 release, upload = response.split("|")
40 if release != '"NA':
41 return release[:4]
42 if upload != 'NA"':
43 return upload[:4]
44 except Exception as e:
45 return None
46
47
48def print_year(year):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected