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

Unable to create file locally from YouTube #1

Closed
YU000jp opened this issue Oct 15, 2023 · 13 comments
Closed

Unable to create file locally from YouTube #1

YU000jp opened this issue Oct 15, 2023 · 13 comments

Comments

@YU000jp
Copy link
Contributor

YU000jp commented Oct 15, 2023

First, thank you for providing such a great plugin. I try and do not know how to use. It looks like the file isn't downloading.

What I did; Run from the menu of the block with "{{youtube URL}}".
Error message:

logseq-whisper-subtitle-server error: [Errno 2] No such file or directory: 
'D:\\ ------ \\logseq-whisper-subtitles-server\\logseq_whisper_subtitles_server\\.\\youtube/youtube_audio_6968954bf60841b48f987933359b93d3.mp3'

My guess is, the server is running. But the file was not found in the directory.

@YU000jp
Copy link
Contributor Author

YU000jp commented Oct 15, 2023

Additionally, server error message:

Downloading the video: https://www.youtube.com/watch?v=v3JX3mzrAoI into audio ...
Traceback (most recent call last):
  File "D:\------\logseq-whisper-subtitles-server\logseq_whisper_subtitles_server\app.py", line 29, in transcribe
    audio_path = download_youtube(youtube_url)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\-----\logseq-whisper-subtitles-server\logseq_whisper_subtitles_server\services.py", line 54, in download_youtube
    audio_stream.download(filename=audio_name, output_path='.')
  File "C:\Python311\Lib\site-packages\pytube\streams.py", line 312, in download
    with open(file_path, "wb") as fh:
         ^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\-----\\logseq-whisper-subtitles-server\\logseq_whisper_subtitles_server\\.\\youtube/youtube_audio_735dad45a111435d9fdd69c81d90e9fa.mp3'
127.0.0.1 - - [15/Oct/2023 10:29:28] "POST /transcribe HTTP/1.1" 200 -

@usoonees
Copy link
Owner

Ah, I understand. The path usage on Windows is different from that on a Mac. I hadn't tested this before, but I'll work on resolving the issue tonight.

@usoonees
Copy link
Owner

First, thank you for providing such a great plugin. I try and do not know how to use. It looks like the file isn't downloading.

What I did; Run from the menu of the block with "{{youtube URL}}". Error message:

logseq-whisper-subtitle-server error: [Errno 2] No such file or directory: 
'D:\\ ------ \\logseq-whisper-subtitles-server\\logseq_whisper_subtitles_server\\.\\youtube/youtube_audio_6968954bf60841b48f987933359b93d3.mp3'

My guess is, the server is running. But the file was not found in the directory.

Apologies for the inconvenience. There was a minor bug related to the file path. Could you please pull the latest version from the main branch and try again?

@YU000jp
Copy link
Contributor Author

YU000jp commented Oct 16, 2023

It seems like progress has been made. But...

Logseq error message: "not supported source yet"

I used this URL. https://youtu.be/v3JX3mzrAoI ({{youtube https://youtu.be/v3JX3mzrAoI}})

I'm not looking for an immediate solution, but just to report. I will also cooperate as much as possible. 🫡

@YU000jp
Copy link
Contributor Author

YU000jp commented Oct 16, 2023

youtube_pattern = r"https://www\.youtube\.com/watch\?v=[a-zA-Z0-9_-]+"

The cause of the problem has been found. The URL did not match the pattern. I will try fixing locally.

@usoonees
Copy link
Owner

usoonees commented Oct 16, 2023

@YU000jp Ah, I see the issue. It seems that the link was missing the "https://youtu.be/" prefix and only had "https://www.youtube.com/". Could you please pull the latest version and try again?
image

@YU000jp
Copy link
Contributor Author

YU000jp commented Oct 16, 2023

Two errors occurred.

  1. "logseq-whisper-subtitle-server error: The size of tensor a (386) must match the size of tensor b (3) at non-singleton dimension 3"

  2. logseq-whisper-subtitle-server error: cannot reshape tensor of 0 elements into shape [1, 0, 8, -1] because the unspecified dimension size -1 can be any value and is ambiguous

@usoonees
Copy link
Owner

Could you please provide me with the complete error stack?

@usoonees
Copy link
Owner

Can you run with the test audio?

cd logseq_whisper_subtitles_server
python services.py

@YU000jp
Copy link
Contributor Author

YU000jp commented Oct 16, 2023

It took some time, but it was reflected in Logseq. After waiting a few minutes, it appears that you received the processing.
I would like to be able to display messages being processed using "logseq.provideUI()".

@usoonees
Copy link
Owner

Yeah, you're right. The speed is tied to the local machine's capabilities. It's a bit slow on CPU; maybe a message should be displayed.

@usoonees
Copy link
Owner

usoonees commented Oct 16, 2023

Just outputting verbose logs to the console for now, which also means it could possibly switch to stream output for logseq, I will try to implement this.

@YU000jp
Copy link
Contributor Author

YU000jp commented Oct 16, 2023

Let me explain just in case. A popup will be displayed when use "logseq.provideUI()".

"logseq.provideUI()" sample code:
https://github.com/YU000jp/logseq-plugin-side-block/blob/31fa885980550180d569510a0d08f9699fca0ace/src/index.ts#L143

Process for remove the popup:
https://github.com/YU000jp/logseq-plugin-side-block/blob/31fa885980550180d569510a0d08f9699fca0ace/src/index.ts#L96C5-L96C95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants