Skip to content

Instantly share code, notes, and snippets.

@dmp40
dmp40 / get_yt_video_id.py
Created September 27, 2022 18:22 — forked from kmonsoor/get_yt_video_id.py
Extract Video-ID from a Youtube url
# initial version: http://stackoverflow.com/a/7936523/617185 \
# by Mikhail Kashkin(http://stackoverflow.com/users/85739/mikhail-kashkin)
def get_yt_video_id(url):
"""Returns Video_ID extracting from the given url of Youtube
Examples of URLs:
Valid:
'http://youtu.be/_lOT2p_FCvA',
'www.youtube.com/watch?v=_lOT2p_FCvA&feature=feedu',