from tkinter.constants import NO
from pytube import YouTube,Playlist

class URLNotEntered(Exception):
    pass

def download_single(url=None):
    try:
        video= YouTube(url).streams.first().download()
        yt = YouTube(url)
        yt.streams.filter(progressive=True,file_extension="mp4").order_by("resolution").desc().first().download()
        
    except Exception as ex:
        raise URLNotEntered("Please enter a (valid) URL")
def download_playlist(url=None):
    
    try:
        yt = Playlist(url)
        for v in yt.videos:
            v.streams.first().download()
    except Exception as ex:
        raise URLNotEntered("Please enter a (valid) URL")

def get_raw_playlist(url=None):
    try:
        pl=Playlist(url)
        return pl
    except:
        raise URLNotEntered("Please enter a (valid) URL")
        
def get_raw_video(url=None):
    try:
        yt=YouTube(url)
        return yt
    except:
        raise URLNotEntered("Please enter a (valid) URL")

b6378804f48f2dd05815e322f0a6f8854bd0d444
<mask token>


class URLNotEntered(Exception):
    pass


def download_single(url=None):
    try:
        video = YouTube(url).streams.first().download()
        yt = YouTube(url)
        yt.streams.filter(progressive=True, file_extension='mp4').order_by(
            'resolution').desc().first().download()
    except Exception as ex:
        raise URLNotEntered('Please enter a (valid) URL')


<mask token>


def get_raw_playlist(url=None):
    try:
        pl = Playlist(url)
        return pl
    except:
        raise URLNotEntered('Please enter a (valid) URL')


<mask token>

<mask token>


class URLNotEntered(Exception):
    pass


def download_single(url=None):
    try:
        video = YouTube(url).streams.first().download()
        yt = YouTube(url)
        yt.streams.filter(progressive=True, file_extension='mp4').order_by(
            'resolution').desc().first().download()
    except Exception as ex:
        raise URLNotEntered('Please enter a (valid) URL')


<mask token>


def get_raw_playlist(url=None):
    try:
        pl = Playlist(url)
        return pl
    except:
        raise URLNotEntered('Please enter a (valid) URL')


def get_raw_video(url=None):
    try:
        yt = YouTube(url)
        return yt
    except:
        raise URLNotEntered('Please enter a (valid) URL')

<mask token>


class URLNotEntered(Exception):
    pass


def download_single(url=None):
    try:
        video = YouTube(url).streams.first().download()
        yt = YouTube(url)
        yt.streams.filter(progressive=True, file_extension='mp4').order_by(
            'resolution').desc().first().download()
    except Exception as ex:
        raise URLNotEntered('Please enter a (valid) URL')


def download_playlist(url=None):
    try:
        yt = Playlist(url)
        for v in yt.videos:
            v.streams.first().download()
    except Exception as ex:
        raise URLNotEntered('Please enter a (valid) URL')


def get_raw_playlist(url=None):
    try:
        pl = Playlist(url)
        return pl
    except:
        raise URLNotEntered('Please enter a (valid) URL')


def get_raw_video(url=None):
    try:
        yt = YouTube(url)
        return yt
    except:
        raise URLNotEntered('Please enter a (valid) URL')

from tkinter.constants import NO
from pytube import YouTube, Playlist


class URLNotEntered(Exception):
    pass


def download_single(url=None):
    try:
        video = YouTube(url).streams.first().download()
        yt = YouTube(url)
        yt.streams.filter(progressive=True, file_extension='mp4').order_by(
            'resolution').desc().first().download()
    except Exception as ex:
        raise URLNotEntered('Please enter a (valid) URL')


def download_playlist(url=None):
    try:
        yt = Playlist(url)
        for v in yt.videos:
            v.streams.first().download()
    except Exception as ex:
        raise URLNotEntered('Please enter a (valid) URL')


def get_raw_playlist(url=None):
    try:
        pl = Playlist(url)
        return pl
    except:
        raise URLNotEntered('Please enter a (valid) URL')


def get_raw_video(url=None):
    try:
        yt = YouTube(url)
        return yt
    except:
        raise URLNotEntered('Please enter a (valid) URL')

from tkinter.constants import NO
from pytube import YouTube,Playlist

class URLNotEntered(Exception):
    pass

def download_single(url=None):
    try:
        video= YouTube(url).streams.first().download()
        yt = YouTube(url)
        yt.streams.filter(progressive=True,file_extension="mp4").order_by("resolution").desc().first().download()
        
    except Exception as ex:
        raise URLNotEntered("Please enter a (valid) URL")
def download_playlist(url=None):
    
    try:
        yt = Playlist(url)
        for v in yt.videos:
            v.streams.first().download()
    except Exception as ex:
        raise URLNotEntered("Please enter a (valid) URL")

def get_raw_playlist(url=None):
    try:
        pl=Playlist(url)
        return pl
    except:
        raise URLNotEntered("Please enter a (valid) URL")
        
def get_raw_video(url=None):
    try:
        yt=YouTube(url)
        return yt
    except:
        raise URLNotEntered("Please enter a (valid) URL")
