hbmartin / pytube3

Deprecated, please see https://github.com/pytube3/pytube3
3 stars 1 forks source link

key error: 'streamingData' #2

Open masikh opened 4 years ago

masikh commented 4 years ago

When trying to initialize a non existing YouTube link I get a key error which is not catched by the pytube3 library. I have to catch it in my own code which I think is dirty.

example:

def init_yt(self): try: self.yt_link = YouTube('https://www.youtube.com/watch?v={yt_key}'.format(yt_key=self.yt_key)) except Exception as error: print('caught error: {error}'.format(error=error))

if I don't do the try/except it will crash on a 'streamingData' key error.

Kind regards,

Robert