Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to populate {audio-media} #145

Closed
Roxiun opened this issue Feb 8, 2023 · 8 comments
Closed

Fails to populate {audio-media} #145

Roxiun opened this issue Feb 8, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@Roxiun
Copy link

Roxiun commented Feb 8, 2023

I'm getting this issue with audio media (screenshots work perfectly). Seems to be similar-ish to #30

[Errno 2] No such file or directory: '/private/var/folders/1x/vbk3tc0s6dx42lnvgysy5gph0000gn/T/memento.ZGvWwp.aac'

I'm using this script: https://codeberg.org/kochi/zoro-mpv (without the virtual environment because of #141 )

This script seems to use mp.set_property("stream-open-filename", files[1]) to open the url it has parased which may have something to do with the issue.

The issue only arises when using this script and not if I manually open the stream url.

@ripose-jp ripose-jp added the bug Something isn't working label Feb 9, 2023
@ripose-jp
Copy link
Owner

Try this patch and tell me if it fixes it.

diff --git a/src/gui/mpvadapter.cpp b/src/gui/mpvadapter.cpp
index cff4130..7794d03 100644
--- a/src/gui/mpvadapter.cpp
+++ b/src/gui/mpvadapter.cpp
@@ -913,6 +913,7 @@ QString MpvAdapter::tempAudioClip(
         NULL
     };
 
+    QByteArray configDir = DirectoryUtils::getConfigDir().toUtf8();
     char *script_opts = NULL;
     mpv_event *event = NULL;
     mpv_handle *enc_h = mpv_create();
@@ -929,7 +930,9 @@ QString MpvAdapter::tempAudioClip(
     mpv_set_option_string(enc_h, "sid", "no");
     mpv_set_option_string(enc_h, "secondary-sid", "no");
     mpv_set_option_string(enc_h, "ytdl", "yes");
+    mpv_set_option_string(enc_h, "config-dir", configDir);
     mpv_set_option_string(enc_h, "config", "no");
+    mpv_set_option_string(enc_h, "load-scripts", "yes");
     mpv_set_option_string(enc_h, "o", filename);
     if (normalize)
     {

@Roxiun
Copy link
Author

Roxiun commented Feb 9, 2023

@ripose-jp

Nope still am getting the same issue

@ripose-jp
Copy link
Owner

Try this one.

diff --git a/src/gui/mpvadapter.cpp b/src/gui/mpvadapter.cpp
index cff4130..8e93c65 100644
--- a/src/gui/mpvadapter.cpp
+++ b/src/gui/mpvadapter.cpp
@@ -521,7 +521,7 @@ int64_t MpvAdapter::getSecondarySubtitleTrack() const
 QString MpvAdapter::getPath() const
 {
     char *path = NULL;
-    if (mpv_get_property(m_handle, "path", MPV_FORMAT_STRING, &path) < 0)
+    if (mpv_get_property(m_handle, "stream-open-filename", MPV_FORMAT_STRING, &path) < 0)
     {
         qDebug() << "Could not get mpv path property";
         return "";

@Roxiun
Copy link
Author

Roxiun commented Feb 10, 2023

Yep that fixed it

@Roxiun
Copy link
Author

Roxiun commented Mar 30, 2023

I'm getting this issue once again while on the latest branch

@ripose-jp
Copy link
Owner

Considering nothing on Memento's end has changed, I'd assume that either zoro, yt-dlp, or mpv changed something. Do zoro videos load? What version of mpv are you using? What version of yt-dlp are you using?

@Roxiun
Copy link
Author

Roxiun commented Mar 31, 2023

Considering nothing on Memento's end has changed, I'd assume that either zoro, yt-dlp, or mpv changed something. Do zoro videos load? What version of mpv are you using? What version of yt-dlp are you using?

Yeah thats true I tested it out with zoro script and it worked (both on latest and other commit).

The issue only arises when I used this animelon script instead. The zoro script worked fine but for whatever reason when using animelon it fails to populate. Videos and subtitles (seems) to load fine its just when populating into anki.

However it seems to load the videos in the exact same way, so I'm not sure whats going on

Versions:

❯ mpv --version
mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Sat Jan 28 04:49:47 2023
FFmpeg library versions:
   libavutil       57.28.100
   libavcodec      59.37.100
   libavformat     59.27.100
   libswscale      6.7.100
   libavfilter     8.44.100
   libswresample   4.7.100
FFmpeg version: 5.1.2

❯ yt-dlp --version
2023.03.04

@ripose-jp
Copy link
Owner

If the Zoro script still works and the Animelon script doesn't, this issue is different. Open a new issue so I can track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants