Skip to content

Instantly share code, notes, and snippets.

@JoJoseph25
Created June 29, 2021 08:19
Show Gist options
  • Save JoJoseph25/20dd084d8b0a7912345d8650aacc50cc to your computer and use it in GitHub Desktop.
Save JoJoseph25/20dd084d8b0a7912345d8650aacc50cc to your computer and use it in GitHub Desktop.
Check if video published within specified data range
from tqdm import tqdm
def check_url(urls, from_date, to_date, add_list, i):
for url in tqdm(urls):
meta_data = parse_video_info(url)
if bool(meta_data):
cur_date = datetime.strptime(meta_data['upload_date'],'%Y-%m-%d')
if cur_date>=from_date and cur_date<to_date:
add_list.append(meta_data)
else:
print('Non-Url', url)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment