Редактирование: Браузер Fork - Wiki:Fork Browser - Forkplayer.tv
Внимание! Вы не авторизовались на сайте. Ваш IP-адрес будет публично видимым, если вы будете вносить любые правки. Если вы войдёте или создадите учётную запись, правки вместо этого будут связаны с вашим именем пользователя, а также у вас появятся другие преимущества.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия | Ваш текст | ||
Строка 81: | Строка 81: | ||
[[Создать_свою_страницу_на_ForkPlayer_Wiki|Создать свою страницу на ForkPlayer Wiki]] - дополнить проект недостающей информацией! | [[Создать_свою_страницу_на_ForkPlayer_Wiki|Создать свою страницу на ForkPlayer Wiki]] - дополнить проект недостающей информацией! | ||
+ | |||
+ | == Пример прасера на Nodejs с обходом РКН через Tor на телефоне андроид c termux == | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | termux | ||
+ | |||
+ | https://f-droid.org/ru/packages/com.termux/ | ||
+ | |||
+ | ---- install ubuntu | ||
+ | https://wiki.termux.com/wiki/PRoot | ||
+ | |||
+ | https://asciinema.org/a/355177 | ||
+ | |||
+ | ---- terminal ubuntu | ||
+ | |||
+ | sudo apt update | ||
+ | sudo apt install nodejs | ||
+ | sudo apt install npm | ||
+ | sudo apt install tor | ||
+ | |||
+ | sudo apt install obfs4proxy | ||
+ | |||
+ | -- if Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/universe/o/obfs4proxy/obfs4proxy_0.0.8-1build2_arm64.deb | ||
+ | |||
+ | -- install optional from http://ports.ubuntu.com/ubuntu-ports/pool/universe/o/obfs4proxy/ | ||
+ | |||
+ | TEMP_DEB="$(mktemp)" && wget -O "$TEMP_DEB" 'http://ports.ubuntu.com/ubuntu-ports/pool/universe/o/obfs4proxy/obfs4proxy_0.0.8-1_arm64.deb' && sudo dpkg -i "$TEMP_DEB" | ||
+ | rm -f "$TEMP_DEB" | ||
+ | |||
+ | ---- https://zalinux.ru/?p=6049 | ||
+ | |||
+ | Get tor bridges https://bridges.torproject.org/options/ | ||
+ | |||
+ | Add works bridges in '/etc/tor/torrc' Ubuntu | ||
+ | |||
+ | ---- | ||
+ | |||
+ | https://www.npmjs.com/package/tor-request | ||
+ | |||
+ | npm install tor-request | ||
+ | |||
+ | npm install pm2 -g | ||
+ | |||
+ | ---- Autostart tor + kinobase.js | ||
+ | |||
+ | add in 'etc/profile' Ubuntu | ||
+ | |||
+ | pm2 start 'DIRname'/kinobase.js; | ||
+ | |||
+ | tor --ExitNodes {ua},{by},{am},{kz}; | ||
+ | |||
+ | ---- Autostart vnc server with port:5901 and ip:192.168.1.xx | ||
+ | |||
+ | add in 'etc/profile' Ubuntu | ||
+ | |||
+ | rm -rf /tmp/.X1-lock; | ||
+ | |||
+ | rm -rf /tmp/.X11-unix/X1; | ||
+ | |||
+ | vncserver -localhost no; | ||
+ | |||
+ | <h1>kinobase.js</h1> | ||
+ | |||
+ | <pre> | ||
+ | const http = require('http'); | ||
+ | const https = require('https'); | ||
+ | const tr = require('tor-request'); | ||
+ | const hostname = '192.168.1.66'; // ip телефона в wifi | ||
+ | const port = 8001; // port | ||
+ | |||
+ | const server = http.createServer((req, res) => { | ||
+ | |||
+ | const headers = { | ||
+ | 'Access-Control-Allow-Origin': '*', | ||
+ | 'Access-Control-Allow-Methods': 'OPTIONS, POST, GET', | ||
+ | 'Access-Control-Allow-Headers': 'Accept, Content-Type', | ||
+ | 'Content-Type': 'text/html; charset=utf-8', | ||
+ | }; | ||
+ | res.writeHead(200, headers); | ||
+ | |||
+ | function returnXml(a, b, c) { | ||
+ | if (!c)c = ""; | ||
+ | return "<channel>\n\ | ||
+ | <title>" + a + " </title>\n\ | ||
+ | <stream_url>" + b + "</stream_url>\n\ | ||
+ | <description><div style='font-size:24px'>" + c + "</div>\n\ | ||
+ | </channel>\n"; | ||
+ | } | ||
+ | |||
+ | if (e = req.url.match(/getm3u8\/(.*?.)((\?|&)box_|$)/)) { | ||
+ | var urlreq = decodeURI(e[1].toString()); | ||
+ | var com = "<items> \n" | ||
+ | tr.request(urlreq, function(err, resTOR, body) { | ||
+ | if (!err && resTOR.statusCode == 200) { | ||
+ | const regexT = /<div class="data clearfix">(.*?)<div id="watch_block">/gms; | ||
+ | while ((m = regexT.exec(body)) !== null) { | ||
+ | com += returnXml('info', 0, ((m[1].replace(/(<([^>]+)>)|\n/gi, "")).trim()).replace(/\s\s\s+/gi, "<br>")) | ||
+ | } | ||
+ | const regf = /MOVIE_ID = (\d+).*?PLAYER_CUID = "(.*?)".*?IDENTIFIER = "(.*?)"/gms; | ||
+ | while ((m = regf.exec(body)) !== null) { | ||
+ | var idm = m[1]; | ||
+ | var CUID = m[2]; | ||
+ | var IDENTIFIER = m[3]; | ||
+ | var time = Math.floor(Date.now() / 100) + '00'; | ||
+ | var requrl = 'https://kinobase.org/user_data?page=movie&movie_id=' + idm + '&cuid=' + CUID + '&device=DESKTOP&_=' + time; | ||
+ | tr.request(requrl, function(err, resTOR, body) { | ||
+ | if (!err && resTOR.statusCode == 200) { | ||
+ | const regs = /"vod_time":(\d+),"vod_hash":"(.*?)"/gms; | ||
+ | while ((m = regs.exec(body)) !== null) { | ||
+ | var vod_time = m[1]; | ||
+ | var vod_hash = m[2]; | ||
+ | time = Date.now(); | ||
+ | var vodurl = 'https://kinobase.org/vod/' + idm + '?identifier=' + IDENTIFIER + '&player_type=new&file_type=hls&st=' + vod_hash + '&e=' + vod_time + '&_=' + time; | ||
+ | tr.request(vodurl, function(err, resTOR, body) { | ||
+ | if (!err && resTOR.statusCode == 200) { | ||
+ | let f; | ||
+ | var regex = /pl\|(.*?)\|/gm; | ||
+ | while ((m = regex.exec(body)) !== null) {f = JSON.parse(m[1])} | ||
+ | //Playlist | ||
+ | if (Array.isArray(f)) { | ||
+ | for (let x of f) { | ||
+ | if (x.playlist) { // have seasons | ||
+ | for (let y of x.playlist) { | ||
+ | var regex = /\[(.*?)\](.*?)(,|$)/gm; // have quality | ||
+ | while ((m = regex.exec(y.file)) !== null) { | ||
+ | if (/\{/.test(m[2])) { | ||
+ | var regex2 = /\{(.*?)\}(http.*?.mp4|http.*?.m3u8)\s+/gi; // have translate | ||
+ | while ((v = regex2.exec(m[2])) !== null) {com += returnXml(x.comment + " " + y.comment + " " + m[1] + " " + v[1], v[2], 0);} | ||
+ | } else { | ||
+ | var regex2 = /(http.*?.mp4|http.*?.m3u8)\s+/gi; // without translate | ||
+ | while ((v = regex2.exec(m[2])) !== null) {com += returnXml(x.comment + " " + y.comment + " " + m[1], v[1], 0);} | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } else { // no have seasons | ||
+ | var regex = /\[(.*?)\](.*?)(,|$)/gm; | ||
+ | while ((m = regex.exec(x.file)) !== null) { | ||
+ | var t = m[2]; //file | ||
+ | if (/\{/.test(t)) { | ||
+ | var regex2 = /\{(.*?)\}(http.*?.mp4|http.*?.m3u8)\s+/gi; // have translate | ||
+ | while ((v = regex2.exec(t)) !== null) {com += returnXml(x.comment + " " + m[1] + " " + v[1], v[2], 0);} | ||
+ | } else { | ||
+ | var regex2 = /(http.*?.mp4|http.*?.m3u8)\s+/gi; // without translate | ||
+ | while ((v = regex2.exec(t)) !== null) {com += returnXml(x.comment + " " + m[1], v[1], 0);} | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | // not playlist | ||
+ | else { | ||
+ | var regex = /\[(.*?)\](.*?)(,|$)/gm; | ||
+ | while ((m = regex.exec(body)) !== null) { | ||
+ | var t = m[2]; //file | ||
+ | if (/\{/.test(t)) { | ||
+ | var regex2 = /\{(.*?)\}(http.*?.mp4|http.*?.m3u8)\s+/gi; // have translate | ||
+ | while ((v = regex2.exec(t)) !== null) {com += returnXml(m[1] + " " + v[1], v[2], 0);} | ||
+ | } else { | ||
+ | var regex2 = /(http.*?.mp4|http.*?.m3u8)\s+/gi; // without translate | ||
+ | while ((v = regex2.exec(t)) !== null) {com += returnXml(m[1], v[1], 0);} | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | com += "</items> \n" | ||
+ | res.write(com); | ||
+ | res.end(); | ||
+ | } | ||
+ | }) | ||
+ | } | ||
+ | } | ||
+ | }) | ||
+ | } | ||
+ | } | ||
+ | }) | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | server.listen(port, hostname, () => {console.log("Server running at "+hostname+":"+port);}); | ||
+ | |||
+ | |||
+ | </pre> | ||
+ | <pre> | ||
+ | адрес для телевизора http://192.168.1.66:8001/getm3u8/https://kinobase.org/film/4756-radiovolna | ||
+ | </pre> |