0

I am trying to download video using YouTube-dl in python, But sometime the video i am trying to download is copyrighted or deleted, So i get an error message from YouTube-dl:

[Example] Example: Downloading embed webpage
[Example] Example: Downloading f webpage
ERROR: Example: File not found

is there anyway i can make the error stop my python program ?

fahad
  • 1
  • 4
  • Use try: except: continue.... – Marcus.Aurelianus Jul 11 '18 at 16:29
  • 1
    Possible duplicate of [Proper way to declare custom exceptions in modern Python?](https://stackoverflow.com/questions/1319615/proper-way-to-declare-custom-exceptions-in-modern-python) – MoxieBall Jul 11 '18 at 16:30
  • @Marcus.Aurelianus i am using this but it doesn't work. – fahad Jul 11 '18 at 16:43
  • @MoxieBall i tried this, did work :( anyway thanks. – fahad Jul 11 '18 at 16:44
  • Where does that error appear? I assume it is returned in some kind of result string, is it not? If `youtube-dl`doesn't throw an error, you might be able to do that by parsing the `result` string, searching for known error messages. – Gabriel Jablonski Jul 11 '18 at 20:11

0 Answers0