Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
damiva authored Jan 23, 2022
1 parent ff7a0ed commit 79aba73
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ for d in *; do
if [ -d "$d" ]; then
echo -e "\n> $d.plug:"
cd $d
tar -cvzf ../$d.200.tgz *
tar -cvzf ../$d.201.tgz *
cd ..
fi
done
2 changes: 1 addition & 1 deletion tivix/favs.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"id":"385-id_xtra","headline":"ID Xtra","image":"http://tv.tivix.co/uploads/posts/2017-11/1511259092_id-investigation-discovery.png"},{"image":"http://tv.tivix.co/uploads/posts/2018-12/1543639816_yu_tv.png","id":"338-yu-tv","headline":"Ю ТВ"},{"id":"210-nst","headline":"НСТ","image":"http://tv.tivix.co/uploads/posts/2016-04/1461317081_nst.png"}]
[{"id":"385-id_xtra","headline":"ID Xtra","image":"http://tv.tivix.co/uploads/posts/2017-11/1511259092_id-investigation-discovery.png"},{"id":"210-nst","headline":"НСТ","image":"http://tv.tivix.co/uploads/posts/2016-04/1461317081_nst.png"},{"image":"http://tv.tivix.co/uploads/posts/2018-12/1543639816_yu_tv.png","id":"338-yu-tv","headline":"Ю ТВ"}]
20 changes: 11 additions & 9 deletions tivix/main.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ if fav {
} else { r = [] }

// msx answer:
props := srv.player(id, true)
props := srv.settings.player(true)
props["trigger:load"] = "execute:service:fetch:" + srv.base_url + "programme.tengo?cid={context:id}"
props["control:type"] = "extended"
props["progress:type"] = "time:hh:mm"
props["label:extension"] = " {ico:msx-white:access-time} {now:time:hh:mm}"
props["tizen:display:mode"] = "PLAYER_DISPLAY_MODE_FULL_SCREEN"
opt := (fav ? "Убрать из" : "Добавить в") + " избранные"
opt := fav ? "Убрать из избранных" : "Добавить в избранные"
r = jsn.encode({
type: "list", headline: "Tivix",
compress: true, items: r,
Expand All @@ -64,13 +64,15 @@ r = jsn.encode({
imageWidth: 1, imageFiller: "smart",
progress: -1, progressColor: "msx-white", titleHeader: "", titleFooter: "",
live: {type: "setup", action: "execute:service:fetch:" + srv.base_url + "programme.tengo?cid={context:id}&now=true"},
properties: props,
options: {
headline: "{context:headline} Меню",
caption: "Меню:{tb}{ico:msx-yellow:stop} " + opt,
template: {enumerate: false, type: "control", layout: "0,0,8,1"},
items: [{key: "yellow", icon: "msx-yellow:stop", label: opt, action: "execute:fetch:" + srv.base_url + "set.tengo?cid={context:id}" + (fav ? "" : "&ttl={context:headline}&img={context:image}")}]
}
properties: props
}, options: {
headline: "{dic:caption:options|options}:",
caption: "{dic:caption:options|options}:{tb}{ico:msx-yellow:stop} {dic:Up|Up}",
template: {type: "control", layout: "0,0,8,1"},
items:[
{key: "yellow", icon: "msx-yellow:stop", label: "{dic:Up|Up}", action: "focus:index:0"},
{type: "space"}, {icon: "menu", label: "{dic:caption:menu|Menu}", action: "menu"}
]
}
})
panic(is_error(r) ? "Encoding playlist error: " + string(r) : undefined)
Expand Down
4 changes: 1 addition & 3 deletions tivix/video.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ for i := txt.last_index(b[3], "//"); i > -1; i = txt.last_index(b[3], "//"){
b[3] = import("base64").decode(b[3])

b = txt.replace(txt.replace(txt.replace(b[3], "{v3}", b[2].text, 1), "{v2}", b[1].text, 1), "{v1}", b[0].text, 1)
//srv.log_inf(b)
b = "http://" + srv.host + "/proxy.m3u8?header=Referer%3A" + srv.encode_uri(url+"/") + "&header=Origin%3A" + srv.encode_uri(url) + "&link=" + srv.encode_uri(b)
//r := srv.request(b, {header: {Referer: url, Origin: txt.trim_suffix(url, "/")}})
//panic(is_error(r) ? r : r.status == 200 ? undefined : r.status)
//srv.log_inf(r.body)
srv.write("{\"response\":{\"status\":200,\"data\":{\"url\":\"", srv.player(srv.read("id"), b), "\"}}}")
srv.write("{\"response\":{\"status\":200,\"data\":{\"url\":\"", txt.trim_prefix(srv.settings.player(b), "video:"), "\"}}}")
5 changes: 4 additions & 1 deletion torlook/magnet.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ u = srv.request(u, {header: {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) Appl
panic(is_error(u) ? u : u.status == 200 ? undefined : u.status)
u = import("text").re_find("(?s)\"<a.+?href='(.+?)'", u.body, 1)[0][1].text

srv.write("{\"response\":{\"status\":200,\"data\":{\"action\":\"content:http://" + srv.host + "/msx/torr?link=" + srv.encode_uri(u) + "\"}}}")
t := srv.read("ttl")
t = t ? ("&ttl=" + srv.encode_uri(t)) : ""

srv.write("{\"response\":{\"status\":200,\"data\":{\"action\":\"content:http://" + srv.host + "/msx/torr?id={ID}&link=" + srv.encode_uri(u) + t + "\"}}}")
32 changes: 21 additions & 11 deletions torlook/main.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ srv := import("server")
jsn := import("json")
txt := import("text")
url := "https://torlook.info/"
act := (srv.read("v") > "0.1.142" ? "replace:content:torlook:" : "content:") + srv.base_url + "?find="
act := (srv.read("v") || "" > "0.1.142" ? "replace:content:torlook:" : "content:") + srv.base_url + "?find="
its := []
stg := srv.memory()
stg = is_array(stg) && len(stg) == 2 ? stg : ["seeders", false]
stg = is_array(stg) && len(stg) == 3 ? stg : ["seeders", false, false]
get := func(s, p) {
r := srv.request(
url + (s ? ("?cinema=on&s=" + srv.encode_uri(s) + "&sort=" + stg[0] + (stg[1] ? "&forced=on" : "")) : "movietop"),
Expand All @@ -19,32 +19,42 @@ if fnd {
if rtn = get(fnd, "(?s)webResult.+?item.+?<a.+?>(.+?)</a>.+?<img.+?src=\"/(.+?)\".+?<a.+?>(.+?)<.+?class=\"size\">(.+?)<.+?class=\"date\">(.+?)<.+?class=\"arrow-up\".+?>(.+?)<.+?data-src=\"(.+?)\""); is_array(rtn) {
for i in rtn { its = append(its, {
headline: txt.re_replace("<.+?>", i[1].text, ""),
titleFooter: txt.join([i[3].text, txt.replace(i[4].text, "&nbsp;", " ", 1), "{ico:calendar-today} " + i[5].text, "{ico:arrow-upward} " + i[6].text], "{tb}{txt:msx-white:|}{tb}"),
titleFooter: i[3].text + "{tb}{ico:msx-white:attach-file}" + txt.replace(i[4].text, "&nbsp;", " ", 1) +
"{tb}{ico:msx-white:calendar-today} " + i[5].text + "{tb}{ico:msx-white:arrow-upward} " + i[6].text,
data: url + srv.encode_uri(i[7].text, true)
})}
}
} else if rtn = get("", "(?s)webResult.+?item.+?<p>.+?href=\"/(.+?)\">(.+?)<.+?torstat.+?<span.+?>(.+?)<"); is_array(rtn) {
for i in rtn {its = append(its, {label: i[2].text, extensionLabel: i[5].text, icon: "search", action: act + i[1].text})}
} else if rtn = get("", "(?s)webResult.+?item.+?<p>.+?href=\"/(.+?)\">(.+?)<.+?<div.+?href=\"(.+?)\".+?torstat.+?<span.+?>(.+?)<"); is_array(rtn) {
for i in rtn {its = append(its, {label: i[2].text, extensionLabel: i[4].text, icon: "search", action: act + i[1].text + "&ttl=" + srv.encode_uri(i[2].text) + ">index:3", data: i[3].text})}
}
if len(its) == 0 {
its = append(its, {icon: "msx-yellow:warning", label: is_string(rtn) ? rtn : "Пусто!", extensionIcon: "msx-white:refresh", action: "reload:content"})
rtn = false
} else {
its[0].focus = fnd ? true : false
rtn = true
}
srv.write(jsn.encode({
type: "list", items: its, flag: "torlook", headline: "Torlook", compress: true,
extension: fnd ? ("{ico:search} {col:msx-white}" + fnd) : "{col:msx-white}ТОП 50 (кинопоиск)",
template: {type: "control", layout: "0,0,16," + (rtn && fnd ? "2" : "1"), action: "execute:service:" + srv.base_url + "magnet.tengo"},
extension: fnd ? ("{ico:search} {col:msx-white}" + fnd) : "{col:msx-white}ТОП-50 (кинопоиск)",
template: {
type: "control", layout: "0,0," + (stg[2] ? "8" : "16") + (rtn && fnd ? ",2" : ",1"), alignment: "title-right",
action: "execute:service:" + srv.base_url + "magnet.tengo?ttl=" + srv.encode_uri(srv.read("ttl") || "")
}, options: {
headline: "{dic:caption:options|options}:",
caption: "{dic:caption:options|options}:{tb}{ico:msx-yellow:stop} {dic:Up|Up}",
template: {type: "control", layout: "0,0,8,1"},
items:[
{key: "yellow", icon: "msx-yellow:stop", label: "{dic:Up|Up}", action: "focus:index:1"},
{type: "space"}, {icon: "menu", label: "{dic:caption:menu|Menu}", action: "menu"}
]
},
header: {compress: true, items: [
{type: "space", layout: "1,0,15,1", offset: "-1,0,1,0", color: "msx-black"},
{type: "button", label: "ТОП 50", action: act, layout: "0,0,2,1"},
{type: "button", label: "ТОП-50", action: act, layout: "0,0,2,1"},
{
type: "control", icon: "search", extensionIcon: "keyboard", layout: "2,0,12,1",
label: fnd || "{col:msx-white-soft}Поиск торрентов", focus: fnd ? false : true,
action: "execute:http://" + srv.host + "/msx/input",
data: {action: "[back|" + act + "{INPUT}]", headline: "Поиск торрентов", value: fnd, extension: "{ico:search}"}
data: {action: "[back|" + act + "{INPUT}>index:3]", headline: "Поиск торрентов", value: fnd, extension: "Torlook"}
},
{type: "button", icon: "settings", iconSize: "small", layout: "14,0,2,1", action: "panel:" + srv.base_url + "settings.tengo"}
]}
Expand Down
29 changes: 15 additions & 14 deletions torlook/settings.tengo
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
srv := import("server")
jsn := import("json")
stg := srv.memory()
stg = is_array(stg) && len(stg) == 2 ? stg : ["seeders", false]
stg = is_array(stg) && len(stg) == 3 ? stg : ["seeders", false, false]
if srv.method == "POST" {
if b := jsn.decode(srv.read()); is_map(b) {
if is_string(b.data) {
stg[0] = b.data
} else {
stg[1] = b.data ? true : false
}
stg[b.data ? 1 : 2] = !stg[b.data ? 1 : 2]
}
}
srv.memory(stg)
srv.write(jsn.encode({response: {status: 200, data: {action: "reload:panel"}}}))
} else {
srv.write(jsn.encode({
type: "list", headline: "Параметры поиска", extension: "torlook", reuse: false, cache: false, restore: false,
r := {
type: "list", headline: "Параметры поиска", extension: "Torlook", reuse: false, cache: false, restore: false,
template: {type: "control", layout: "0,0,8,1", action: "execute:service:" + srv.base_url + "settings.tengo", enumerate: false},
items: [
{icon: "radio-button-" + (stg[0] == "seeders" ? "on" : "off"), label: "сортировать по сидам", data: "seeders"},
{icon: "radio-button-" + (stg[0] == "size" ? "on" : "off"), label: "сортировать по размеру", data: "size"},
{icon: "radio-button-" + (stg[0] == "date" ? "on" : "off"), label: "сортировать по дате", data: "date"},
{icon: "check-box" + (stg[1] ? "" : "-outline-blank"), label: "форсированный поиск", data: !stg[1]},
{type: "space"},
{type: "button", label: "Обновить результаты поиска", action: "[back|reload:content]", offset: "2,0,-4,0"}
]
}))
items: [{icon: "view-list", label: "представление списка", extensionLabel: "{ico:" + (stg[2] ? "" : "msx-white:") + "splitscreen} {ico:msx-white:toggle-o" + (stg[2] ? "n" : "ff") + "} {ico:" + (stg[2] ? "msx-white:" : "") + "grid-view}", data: false}]
}
for s in [["сидам", "seeders"], ["размеру", "size"], ["дате", "date"]] {
r.items = append(r.items, {icon: "sort", label: "сортировать по " + s[0], extensionIcon: stg[0] == s[1] ? "msx-white:radio-button-on" : "radio-button-off", data: s[1]})
}
r.items = append(r.items,
{icon: "manage-search", label: "форсированный поиск", extensionIcon: stg[1] ? "msx-white:check-box" : "check-box-outline-blank", data: true},
{type: "button", label: "Обновить результаты поиска", action: "[back|reload:content]", offset: "2,0,-4,0"}
)
srv.write(jsn.encode(r))
}

0 comments on commit 79aba73

Please sign in to comment.