mirror of
https://github.com/OMGeeky/twba_downloader.git
synced 2026-02-13 21:18:10 +01:00
fix some bugs & update
This commit is contained in:
@@ -33,7 +33,7 @@ async fn run() -> Result<()> {
|
||||
let conf = Conf::builder()
|
||||
.env()
|
||||
.file("./settings.toml")
|
||||
.file("/home/omgeeky/twba/config.toml")
|
||||
.file(shellexpand::tilde("~/twba/config.toml").to_string())
|
||||
.load()
|
||||
.map_err(|e| {
|
||||
error!("Failed to load config: {:?}", e);
|
||||
|
||||
@@ -36,12 +36,13 @@ impl TwitchClient {
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub async fn download_video<VideoId: DIntoString, QUALITY: DIntoString>(
|
||||
&self,
|
||||
id: i32,
|
||||
video_id: VideoId,
|
||||
quality: QUALITY,
|
||||
output_folder: &Path,
|
||||
) -> Result<PathBuf> {
|
||||
let video_id = video_id.into();
|
||||
let folder_path = output_folder.join(&video_id);
|
||||
let folder_path = output_folder.join(id.to_string());
|
||||
let final_path = output_folder.join(format!("{}.mp4", video_id));
|
||||
if final_path.exists() {
|
||||
return Err(DownloadFileError::TargetAlreadyExists(final_path).into());
|
||||
|
||||
Reference in New Issue
Block a user