Comments (9)
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.
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.
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.
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.
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.
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.
You can find windows builds here: https://github.com/BtbN/FFmpeg-Builds/releases
from yt-to-anki.
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.
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)
- Maintain a pyproject.toml or a requirements.txt file to track development dependencies HOT 2
- Feature request: Progress indication when downloading YouTube video
- Error handling when downloading YouTube videos and subtitles: Detect if a video / subtitles have been downloaded or failed HOT 1
- DeprecationWarning: invalid escape sequence '\d' HOT 1
- Extend subtitles parser to recognize the format of automatically generated subtitles HOT 2
- Smarter subtitles cutting optimization for automatically and not automatically generated subtitles HOT 2
- Feature: System readiness check screen HOT 1
- Auto-fill or memorize as many UI fields as possible
- Deprecation warnings: please use 'set_current', 'by_name', 'add_file'
- The extension crashes when reopening the app and while trying to read the stored settings
- YouTube downloader bug: Unable to extract uploader id HOT 2
- Error in the production version of the extension: No module named "fileinput" HOT 2
- Still not working in Anki 2.1.60 HOT 6
- Man-made subtitles not being recognized as such, fallback to auto-generated subs throws error HOT 1
- Why do I have ffmpeg installed on my mac and it still doesn't work HOT 3
- mp3 file not found when generating deck HOT 1
- Add-on failed to load HOT 1
- Migrate to QT6 HOT 1
- Generate 0 cards in 0.0 seconds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yt-to-anki.