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

YouTube to mp3 v3 #132

Merged
merged 5 commits into from
Jul 13, 2024
Merged

YouTube to mp3 v3 #132

merged 5 commits into from
Jul 13, 2024

Conversation

friendbear
Copy link
Owner

No description provided.

@friendbear friendbear self-assigned this Jul 13, 2024
Copy link
Collaborator

@github-friendbear github-friendbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finish Review.
@friendbear

@@ -14,5 +14,7 @@ dotenv = "0.15"
hyper = "0.14"
hyper-rustls = "0.26"
reqwest = { version = "0.11.9", features = ["json", "blocking"] }
serde = "1.0.204"
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point:)

let api_key = env::var("YOUTUBE_API_KEY").expect("YOUTUBE_API_KEY must be set");
let query = "Hatsune Miku"; // 検索クエリを設定する

match search_videos(&api_key, query).await {
Ok(results) => {
if let Some(video) = results.first() {
dbg!(video);
if let Err(err) = download_video(&api_key, &video.id.videoId, "~/Music/Miku").await {
if let Err(err) = download_video(&api_key, &video.id.videoId, "~/Music/Miku").await
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default path を変える必要を検討。

let status = Command::new("youtube-dl")
let status = Command::new("yt-dlp")
.arg("-f")
.arg("bestvideo[ext=webm]+bestaudio[ext=webm]/best[ext=webm]")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yt-dlp のオプションの意味を調べる。


let status = Command::new("ffmpeg")
.arg("-i")
.arg(input_path)
.arg(input_path.to_string_lossy().to_string())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to_string_lossy()

  • 変換後の文字列は?

@friendbear friendbear merged commit 566454a into main Jul 13, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants