DLSystem check for youtube-dl

This commit is contained in:
2022-07-02 00:36:36 +00:00
parent 4b52ccdd9f
commit ec92fe80ce
11 changed files with 50 additions and 12 deletions

View File

@@ -0,0 +1,8 @@
package nat.systems;
import kiss.Prelude;
import kiss.List;
import nat.System;
@:build(kiss.Kiss.build())
class DLSystem extends System {}

View File

@@ -0,0 +1,16 @@
(load "../Lib.kiss")
(defNew []
// Check if youtube-dl is installed before doing anything
(let [&mut hasYTDL false]
(tryProcess "youtube-dl" [] ->error (when (contains error "You must provide at least one URL") (set hasYTDL true)))
(super
->[archive e]
(and ~hasYTDL (catsMatch e "(unless dlProcessed DLURL)"))
->[archive e &opt ui]
{
// (addFiles )
// (addTags archive e ["dlProcessed"])
})))

View File

@@ -5,5 +5,5 @@
:EntryProcessor processor]
[]
(super
(lambda [:Archive archive :Entry e] (tagsMatch archive e tagFilterString))
(lambda [:Archive archive :Entry e] (tagsMatch e tagFilterString))
processor))

View File

@@ -3,7 +3,7 @@
(defNew []
(super
"https://en.wikipedia.org/w/api.php"
->[archive e] (tagsMatch archive e "(and media !wikipediaProcessed)")
->[archive e] (tagsMatch e "(and media !wikipediaProcessed)")
scrapeForImages
1))