Giter Club home page Giter Club logo

Comments (9)

kamui-fin avatar kamui-fin commented on June 11, 2024

Have you tried using the newly added dev task? Be sure to also create a symbolic link between the dist and the addon directory.

from yt-to-anki.

stanislaw avatar stanislaw commented on June 11, 2024

I have tried it like you recommended and I am getting this:

Fehler
Eine der installierten Erweiterungen konnte nicht geladen werden. Wenn das Problem weiter besteht, bitte über den Menüpunkt Extras → Erweiterungen die Erweiterungen deaktivieren oder deinstallieren

Beim Laden von '⁨964531817⁩':
⁨Traceback (most recent call last):
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aqt/addons.py", line 247, in loadAddons
  __import__(addon.dir_name)
  File "/Users/stanislaw/Library/Application Support/Anki2/addons21/964531817/__init__.py", line 10, in <module>
  from .main import launch
  File "/Users/stanislaw/Library/Application Support/Anki2/addons21/964531817/main.py", line 8, in <module>
  from . import worker
  File "/Users/stanislaw/Library/Application Support/Anki2/addons21/964531817/worker.py", line 12, in <module>
  from .client_youtube import SubtitleRange, YouTubeClient, YouTubeDownloadResult
  File "/Users/stanislaw/Library/Application Support/Anki2/addons21/964531817/client_youtube.py", line 7, in <module>
  import youtube_dl
ModuleNotFoundError: No module named 'youtube_dl'

Does it mean that you recommend now to install youtube_dl from pip?

from yt-to-anki.

kamui-fin avatar kamui-fin commented on June 11, 2024

Is there a lib directory that was generated in dist/ with the youtube_dl library bundled? And is the poetry environment activated? Make sure to run poetry install before running the dev task.

from yt-to-anki.

stanislaw avatar stanislaw commented on June 11, 2024

It would be great if you'd put together a small README section for how this should work. The invoke dev produces this result:

code/yt2srs (master) $ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
code/yt2srs (master) $ invoke dev
Traceback (most recent call last):
  File "/Users/stanislaw/.pyenv/versions/3.11.1/bin/invoke", line 8, in <module>
    sys.exit(program.run())
             ^^^^^^^^^^^^^
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/invoke/program.py", line 380, in run
    self.execute()
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/invoke/program.py", line 565, in execute
    executor.execute(*self.tasks)
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/invoke/executor.py", line 127, in execute
    result = call.task(*args, **call.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/invoke/tasks.py", line 115, in __call__
    result = self.body(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stanislaw/workspace/projects/code/yt2srs/tasks.py", line 140, in dev
    package_dev(context)
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/invoke/tasks.py", line 115, in __call__
    result = self.body(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stanislaw/workspace/projects/code/yt2srs/tasks.py", line 132, in package_dev
    bundle_ffmpeg(context)
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/invoke/tasks.py", line 115, in __call__
    result = self.body(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stanislaw/workspace/projects/code/yt2srs/tasks.py", line 124, in bundle_ffmpeg
    copytree("ffmpeg", "dist", dirs_exist_ok=True)
  File "/Users/stanislaw/.pyenv/versions/3.11.1/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 559, in copytree
    with os.scandir(src) as itr:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

from yt-to-anki.

kamui-fin avatar kamui-fin commented on June 11, 2024

I will compile the development workflow information into the README. As far as the ffmpeg error goes, it assumes that you have a directory called ffmpeg/ with the executable ffmpeg.exe inside.

from yt-to-anki.

stanislaw avatar stanislaw commented on June 11, 2024

As far as the ffmpeg error goes, it assumes that you have a directory called ffmpeg/ with the executable ffmpeg.exe inside.

This I understand but where am I supposed to get these ffmpeg files?

Previously, I could get them by installing your extension via Anki and then replacing the code files with those from my repo. How do you obtain the ffmpeg.exe?

from yt-to-anki.

kamui-fin avatar kamui-fin commented on June 11, 2024

You can find windows builds here: https://github.com/BtbN/FFmpeg-Builds/releases

from yt-to-anki.

stanislaw avatar stanislaw commented on June 11, 2024

Ok, the FFmpeg is ok but I am still missing some info.

Does it mean that with your new setup, I have to run invoke dev every time I make a change in the Python code?

Could we adjust this setup a little that during the development, I could symlink directly to the root of this repository? Would a root-level __init__ pointing to the ytsrs/__init__.py solve the problem?

from yt-to-anki.

stanislaw avatar stanislaw commented on June 11, 2024

Now I see: I was running Anki from its source and you are calling Anki via its Python interface. Now that I understand how this works, the approach of continuously running invoke dev makes sense.

@task()
def anki(context):
    import aqt

    aqt.run()

I found some problems with has_ffmpeg on macOS, I will send a PR now. It would be great to have this merged first because it contains a bug with a home directory variable: #26.

from yt-to-anki.

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.