# Made with python3
# (C) @FayasNoushad
# Copyright permission under MIT License
# All rights reserved by FayasNoushad
# License -> https://github.com/FayasNoushad/Youtube-Video-Thumbnail/blob/main/LICENSE


def thumbnail(video):
    if ("youtube.com" in video) and ("/" in video) and ("=" in video):
        id = video.split("=")[-1]
    elif ("youtu.be" in video) and ("/" in video):
        id = video.split("/")[-1]
    else:
        id = video
    thumbnail = "https://img.youtube.com/vi/" + id + "/sddefault.jpg"
    return thumbnail

