-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
YouTube to mp3 v3 #132
Conversation
There was a problem hiding this 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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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]") |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to_string_lossy()
- 変換後の文字列は?
No description provided.