Git Product home page Git Product logo

Comments (5)

ColdGrub1384 avatar ColdGrub1384 commented on May 29, 2024

Thanks for reporting. The error is raised by youtube_dl on file youtube_dl/utils.py.

try:
    upload_date = datetime.datetime(*timetuple[:6]).strftime('%Y%m%d')
except ValueError:
     pass

It's raised on this line:

upload_date = datetime.datetime(*timetuple[:6]).strftime('%Y%m%d')

The script only catches ValueError but a TypeError is raised so the error isn't handled.

I replaced

try:
    upload_date = datetime.datetime(*timetuple[:6]).strftime('%Y%m%d')
except ValueError:
     pass

by

try:
    upload_date = datetime.datetime(*timetuple[:6]).strftime('%Y%m%d')
except ValueError:
     pass
except TypeError:
     pass

To fix the error run these commands:

$ rm ~/Documents/site-packages3/youtube_dl/utils.py
$ curl https://raw.githubusercontent.com/ColdGrub1384/youtube-dl_LibTerm/master/youtube_dl/utils.py -o site-packages3/youtube_dl/utils.py

from libterm.

masterxp22 avatar masterxp22 commented on May 29, 2024

Thank you very much for the fix. It works!
So does this behavior of Libterm is right?
For example in Pythonista it doesn’t give this error (even without the fix).
And even in Libterm if i execute script (without the fix) in python’s console multiple times it works. But if i quit console with “stop” button and re execute script it will give error, otherwise quiting python with os._exit(0) it works.

from libterm.

ColdGrub1384 avatar ColdGrub1384 commented on May 29, 2024

The behavior of LibTerm is different than Pythonista. And both are also different than on a computer.
Pythonista is an IDE, without command line (except the REPL). What Pythonista does is that the REPL is always running and runs scripts on top of it. LibTerm runs the interpreter and when its stoped the thread running it is stopped. So I think the problem should be when "Stop" is pressed the thread is just stopped but no cleanup functions is called. I will include this youtube_dl version in the next update.

from libterm.

masterxp22 avatar masterxp22 commented on May 29, 2024

Very well! Do you know a way to call a cleanup function after executing a script from file with python?
It could be a fix for other modules. Or you should include it in stop button and after a script file finish to run. Because for example after youtube-dl’s bug, sometimes python crash on startup and cleanup with os._exit() doesn’t work anymore.
The only way is to kill the app.

from libterm.

masterxp22 avatar masterxp22 commented on May 29, 2024

I’m not sure Apple will appreciate youtube-dl on AppStore. :D Be carefull we don’t want Libterm to be removed from AppStore.

from libterm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.