This repository has been archived by the owner on Sep 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ temp/* | |
youtube-dl-*/* | ||
Download/* | ||
ydl.ahk.ini | ||
*.exe | ||
*.sublime* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--ignore-errors | ||
--geo-bypass | ||
--retries infinite | ||
--fragment-retries infinite | ||
--skip-unavailable-fragments | ||
--cache-dir temp | ||
--add-metadata | ||
|
||
--external-downloader aria2c | ||
--external-downloader-args "--disk-cache 128M --summary-interval 0 --console-log-level warn --max-tries 0 --retry-wait 1 --split 16 --max-connection-per-server 16 --min-split-size 1M" | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
--output "%ydl_home%/%(uploader)s [%(playlist_id)s]/%(playlist_index)03d - %(title)s [%(id)s].%(ext)s" | ||
|
||
--playlist-reverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--ignore-errors | ||
--geo-bypass | ||
--retries infinite | ||
--fragment-retries infinite | ||
--skip-unavailable-fragments | ||
--cache-dir temp | ||
--add-metadata | ||
|
||
--external-downloader aria2c | ||
--external-downloader-args "--disk-cache 128M --summary-interval 0 --console-log-level warn --max-tries 0 --retry-wait 1 --split 16 --max-connection-per-server 16 --min-split-size 1M" | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
--output "%ydl_home%/%(uploader)s - %(title)s [%(id)s] (%(resolution)s).%(ext)s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--ignore-errors | ||
--geo-bypass | ||
--retries infinite | ||
--fragment-retries infinite | ||
--skip-unavailable-fragments | ||
--cache-dir temp | ||
--add-metadata | ||
|
||
--external-downloader aria2c | ||
--external-downloader-args "--disk-cache 128M --summary-interval 0 --console-log-level warn --max-tries 0 --retry-wait 1 --split 16 --max-connection-per-server 16 --min-split-size 1M" | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
--output "%ydl_home%/%(playlist_title)s [%(playlist_id)s]/%(uploader)s - %(title)s [%(id)s] (%(resolution)s).%(ext)s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--ignore-errors | ||
--geo-bypass | ||
--retries infinite | ||
--fragment-retries infinite | ||
--skip-unavailable-fragments | ||
--cache-dir temp | ||
--add-metadata | ||
|
||
--external-downloader aria2c | ||
--external-downloader-args "--disk-cache 128M --summary-interval 0 --console-log-level warn --max-tries 0 --retry-wait 1 --split 16 --max-connection-per-server 16 --min-split-size 1M" | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
--output "%ydl_home%/%(uploader)s - %(playlist_title)s [%(playlist_id)s]/%(playlist_index)03d - %(title)s [%(id)s].%(ext)s" | ||
|
||
--playlist-reverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--ignore-errors | ||
--geo-bypass | ||
--retries infinite | ||
--fragment-retries infinite | ||
--skip-unavailable-fragments | ||
--cache-dir temp | ||
--add-metadata | ||
|
||
--external-downloader aria2c | ||
--external-downloader-args "--disk-cache 128M --summary-interval 0 --console-log-level warn --max-tries 0 --retry-wait 1 --split 16 --max-connection-per-server 16 --min-split-size 1M" | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
--output "%ydl_home%/%(uploader)s - %(playlist_title)s [%(playlist_id)s]/%(playlist_index)03d - %(title)s [%(id)s].%(ext)s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo off | ||
setlocal | ||
|
||
:start | ||
set retry_err=1 | ||
|
||
echo. | ||
echo.^> %date% %time% | ||
echo.RUNNING: | ||
echo.%* | ||
echo. | ||
|
||
call %* && set retry_err=0 | ||
|
||
if ["%retry_err%"]==["1"] echo.ERROR, Retrying... | ||
echo.--------------------------------------------------- | ||
echo. | ||
|
||
if %retry_err%==1 goto :start | ||
|
||
pause | ||
exit /b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
SetWorkingDir, % A_ScriptDir | ||
#SingleInstance, force | ||
#NoEnv | ||
#NoTrayIcon | ||
|
||
EnvSet, ydl_dir, % A_ScriptDir | ||
global SCRNAME:="Youtube Downloader" | ||
|
||
global Path:=getOpt("path", A_WorkingDir "\Download"), Opts:=getOpt("opts"), Prof:=getOpt("profile","<NONE>"), URL, resSign:=getOpt("sign",">="), Res:=getOpt("res","720") | ||
|
||
Gui, Margin, 10, 10 | ||
|
||
Gui, Add, Text, W50 Right ym+5, URLs | ||
Gui, Add, Edit, vURL x+m W400 yp-5 R5 | ||
|
||
Gui, Add, Text, W50 Right xm y+15, Options | ||
Gui, Add, Edit, vOpts x+m W400 yp-5 R2, % Opts | ||
|
||
Gui, Add, Text, W50 Right y+15 xm, Path | ||
Gui, Add, Edit, vPath x+m W380 yp-5, % Path | ||
Gui, Add, Button, gPathClicked yp-1 x+0 W20, ... | ||
|
||
Gui, Add, Text, xm y+15 W50 Right, Resolution | ||
Gui, Add, DropDownList, vresSign x+m yp-5 W40 section section, >=|<= | ||
guiSet("resSign", resSign, "ChooseString") | ||
Gui, Add, ComboBox, vRes x+0 yp W50, 0|144|360|480|720|1080|2160 | ||
guiSet("Res", Res) | ||
|
||
Gui, Add, Text, x+m yp+5 W50 Right, Profile | ||
Gui, Add, ComboBox, vProf x+m yp-5 W100, % createProfList() | ||
guiSet("Prof", Prof) | ||
|
||
Gui, Add, Button, Default gDownload yp-1 xs+330 W70, Download | ||
|
||
Gui, Show,, % SCRNAME | ||
Return | ||
|
||
|
||
|
||
GuiClose: | ||
ExitApp | ||
|
||
guiSet(key, val, type="Text") { | ||
GuiControl, % type, % key, % val | ||
} | ||
|
||
createProfList() { | ||
ret:="<NONE>" | ||
Loop, Files, *.conf | ||
ret.="|" subStr(A_LoopFileName, 1, -5) | ||
return ret | ||
} | ||
|
||
Download(){ | ||
Gui, +OwnDialogs | ||
Gui, Submit, NoHide | ||
if !validate() | ||
return | ||
|
||
urls := !regexReplace(URL,"S)\s+")?"": "-- """ RegexReplace(url,"S)\s+", " ") """" | ||
getAud := Res==0? "-x -f bestaudio" :"" | ||
format := "--format-sort """ (resSign=="<="?"":"+") "height:" res ",width,proto_preference,+fps,codec_preference,+filesize,+filesize_approx,+tbr,+vbr,+abr,audio_codec_preference""" | ||
prof := Prof=="<NONE>"?"": "--config-location """ Prof ".conf""" | ||
EnvSet, ydl_home, % Path | ||
|
||
cmd := "retry.cmd youtube-dl " prof " " format " " getAud " " Opts " " urls | ||
msgbox % cmd | ||
run, % cmd | ||
} | ||
|
||
PathClicked(){ | ||
Gui, +OwnDialogs | ||
GuiControlGet, current,, Path | ||
FileSelectFolder, folder, % current, 3 | ||
guiSet("Path", folder? folder :current) | ||
} | ||
|
||
validate(){ | ||
if !URL{ | ||
msgbox, % 48+4+256, % SCRNAME, No URL given. `nAre you sure you want to continue? | ||
IfMsgBox, No | ||
return False | ||
} | ||
|
||
if Res is not integer | ||
return showErr("Resolution", Res) | ||
if Res<0 | ||
return showErr("Resolution", Res) | ||
|
||
Path:=RegExReplace(Path, "\\$") | ||
FileCreateDir, % Path | ||
if !InStr(FileExist(Path), "D") | ||
return showErr("Path", Path) | ||
|
||
if (Prof!="<NONE>" && !FileExist(Prof ".conf")) | ||
return showErr("Profile", Prof) | ||
|
||
saveOpt("path", Path) | ||
saveOpt("profile", Prof) | ||
saveOpt("opts", Opts) | ||
saveOpt("sign", resSign) | ||
saveOpt("res", Res) | ||
return true | ||
} | ||
|
||
showErr(key, val) { | ||
msgbox, 16, % SCRNAME, "%val%" is not a valid %key% | ||
return false | ||
} | ||
|
||
saveOpt(key, val) { | ||
IniWrite, % val, % A_ScriptFullPath ".ini", Options, % key | ||
} | ||
|
||
getOpt(key, def:=" ") { | ||
IniRead, out, % A_ScriptFullPath ".ini", Options, % key, % def | ||
return out | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@setlocal | ||
@py "%~dp0\youtube-dl-my-tweaks\youtube_dl\__main__.py" %* | ||
@echo. | ||
@exit /b |