DLSystem check for youtube-dl
This commit is contained in:
8
projects/nat-archive-tool/src/nat/systems/DLSystem.hx
Normal file
8
projects/nat-archive-tool/src/nat/systems/DLSystem.hx
Normal 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 {}
|
||||
16
projects/nat-archive-tool/src/nat/systems/DLSystem.kiss
Normal file
16
projects/nat-archive-tool/src/nat/systems/DLSystem.kiss
Normal 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"])
|
||||
})))
|
||||
@@ -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))
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user