-
Notifications
You must be signed in to change notification settings - Fork 29
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
yt-dlp support #31
base: main
Are you sure you want to change the base?
yt-dlp support #31
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.
Hi, thanks for the PR! I've added some comments :)
@@ -88,6 +89,7 @@ pub struct ChannelConfig { | |||
pub outpath: String, | |||
/// If not present, will be fetched during runtime. | |||
pub picture_url: Option<String>, | |||
pub recorder: String, // TODO: Check this is a valid recorder on config load. |
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.
I think it'd be better if you make an enum instead of using a string here
.ok_or(anyhow!("Failed to get filename"))?; | ||
let destpath = Path::new(&task.output_directory).join(filename); | ||
|
||
// Try to rename the file into the output directory |
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.
I think this rename-otherwise-copy logic can be pulled out to a separate utility module
video_status: VideoStatus, | ||
} | ||
|
||
impl YTDOutputParser { |
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.
Since ytarchive and yt-dlp uses a similar method to parse the command line output, I think it'd be good if you can create an OutputParser
trait, so both YTDOutputParser
and YTAOutputParser
shares the same interface.
return; | ||
} | ||
|
||
let waiting_text = "[wait] Remaining time until next attempt:"; // Does it make sense to have this as a variable? Move to constant? |
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.
I think it's fine, it'll (probably) get optimized into a constant anyway.
Initial implementation supporting yt-dlp as a recorder. I'm fairly new to Rust so I may be doing some silly things.
I want to add some tests and move the shared logic from the
record
function. Everything works from my testing. I'll need to do a bit more, before I'm confident in the yt-dlp side.