fix cache dir issue when used in command templates
This commit is contained in:
parent
39119738ef
commit
9240242240
1 changed files with 1 additions and 1 deletions
|
|
@ -1442,7 +1442,7 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
|
|
||||||
if (downloadItem.extraCommands.isNotBlank() && downloadItem.type != DownloadViewModel.Type.command){
|
if (downloadItem.extraCommands.isNotBlank() && downloadItem.type != DownloadViewModel.Type.command){
|
||||||
// check for cache dir as extra command and add it as an actual option to prevent --no-cache-dir in youtubedl_android
|
// check for cache dir as extra command and add it as an actual option to prevent --no-cache-dir in youtubedl_android
|
||||||
val cacheDirArg = """(--cache-dir (".*"))""".toRegex().find(downloadItem.extraCommands)
|
val cacheDirArg = """--cache-dir\s+"([^"]+)"""".toRegex().find(downloadItem.extraCommands)
|
||||||
if (cacheDirArg != null) {
|
if (cacheDirArg != null) {
|
||||||
ytDlRequest.addOption("--cache-dir", cacheDirArg.groupValues.last().replace("\"", ""))
|
ytDlRequest.addOption("--cache-dir", cacheDirArg.groupValues.last().replace("\"", ""))
|
||||||
runCatching {
|
runCatching {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue