|
@if (@a==@b) @end /* |
|
@echo off |
|
setlocal EnableDelayedExpansion |
|
|
|
if "%~1"=="/?" goto usage |
|
if %0 == "%~0" ( |
|
title nava.downloader.bat |
|
set /p INPUT="URL: " |
|
) else ( |
|
set "INPUT=%~1" |
|
) |
|
if "%INPUT%"=="" goto usage |
|
if /i "%INPUT:~0,5%"=="https" ( |
|
if /i "%INPUT:~6,13%"=="//nava.hu/id/" goto valid |
|
if /i "%INPUT:~6,16%"=="//nava.hu/embed/" goto valid |
|
) |
|
goto invalid |
|
|
|
:valid |
|
where /q youtube-dl |
|
if ERRORLEVEL 1 ( |
|
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://yt-dl.org/latest/youtube-dl.exe', '%~dp0\youtube-dl.exe')" |
|
) |
|
|
|
rem echo "%INPUT%" |
|
for /f "tokens=1-4 delims=|" %%I in ('cscript /nologo /e:jscript "%~f0" "%INPUT%"') do ( |
|
rem echo "%%I" |
|
rem echo "%%J" |
|
rem echo "%%~K" |
|
rem echo "%%L" |
|
set URL=%%I |
|
if "!URL:~-1!"=="=" ( |
|
for /f "usebackq" %%B in (`powershell -Command "(New-Object Net.WebClient).DownloadString('%%I').Split([Environment]::NewLine,[StringSplitOptions]::RemoveEmptyEntries)[-1].Trim().Replace('_pd60000','_pd0')"`) do ( |
|
set URL=%%B |
|
) |
|
) |
|
rem echo "!URL!" |
|
set NAME=%%K |
|
if not "%%L"=="" powershell -Command "(New-Object Net.WebClient).DownloadFile('%%L', '%cd%\!NAME!.srt')" |
|
:try |
|
rem echo "!NAME!" |
|
youtube-dl "!URL!" -o "!NAME!.mp4" |
|
if not exist "!NAME!.mp4" ( |
|
echo Varakozas a videora... |
|
timeout 30 |
|
goto try |
|
) |
|
) |
|
goto :EOF |
|
|
|
:invalid |
|
echo Ervenytelen URL |
|
echo |
|
:usage |
|
echo Hasznalat: %~nx0 URL |
|
echo pl.: %~nx0 https://nava.hu/id/* |
|
if %0 == "%~0" pause |
|
goto :EOF |
|
|
|
JScript */ |
|
var INPUT = WSH.Arguments(0); |
|
var ID = INPUT.split('/')[4]; |
|
var SUB = ''; |
|
var TITLE = ''; |
|
var x = new ActiveXObject('Microsoft.XMLHTTP'); |
|
var UA = String('\x4D\x6F\x7A\x69\x6C\x6C\x61\x2F\x35\x2E\x30\x20\x28\x57\x69\x6E\x64\x6F\x77\x73\x20\x4E\x54\x20\x31\x30\x2E\x30\x3B\x20\x57\x69\x6E\x36\x34\x3B\x20\x78\x36\x34\x29\x20\x41\x70\x70\x6C\x65\x57\x65\x62\x4B\x69\x74\x2F\x35\x33\x37\x2E\x33\x36\x20\x28\x4B\x48\x54\x4D\x4C\x2C\x20\x6C\x69\x6B\x65\x20\x47\x65\x63\x6B\x6F\x29\x20\x43\x68\x72\x6F\x6D\x65\x2F\x38\x30\x2E\x30\x2E\x33\x39\x38\x37\x2E\x31\x34\x39\x20\x53\x61\x66\x61\x72\x69\x2F\x35\x33\x37\x2E\x33\x36'); |
|
|
|
x.open('GET',String(INPUT),true); |
|
x.setRequestHeader('User-Agent',UA); |
|
x.send(''); |
|
while (x.readyState!=4) {WSH.Sleep(50)}; |
|
|
|
if (x.responseText.indexOf('"tracks":[{"file":"') !== -1) { |
|
SUB = 'https:'+x.responseText.split('"tracks":[{"file":"')[1].split('"')[0].replace(/\\/g,''); |
|
} |
|
if (x.responseText.indexOf('<meta property="og:title" content="') !== -1) { |
|
TITLE = x.responseText.split('<meta property="og:title" content="')[1].split('"')[0].replace(/\\/g,''); |
|
} |
|
|
|
var htmlfile = WSH.CreateObject('htmlfile'), JSON; |
|
htmlfile.write('<meta http-equiv="x-ua-compatible" content="IE=9" />'); |
|
htmlfile.close(JSON = htmlfile.parentWindow.JSON); |
|
|
|
if (!TITLE){ |
|
x.open('GET',String('\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6E\x61\x76\x61\x2E\x68\x75\x2F\x77\x70\x2D\x63\x6F\x6E\x74\x65\x6E\x74\x2F\x70\x6C\x75\x67\x69\x6E\x73\x2F\x68\x6D\x73\x2D\x6E\x61\x76\x61\x2F\x69\x6E\x74\x65\x72\x66\x61\x63\x65\x2F\x63\x6C\x61\x73\x73\x65\x73\x2F\x63\x61\x63\x68\x65\x4D\x61\x6E\x61\x67\x65\x72\x2E\x70\x68\x70\x3F\x73\x6F\x6C\x72\x55\x72\x6C\x3D\x26\x62\x6C\x6F\x67\x49\x64\x3D\x32\x26\x69\x64\x3D')+ID,true); |
|
x.setRequestHeader('User-Agent',UA); |
|
x.send(''); |
|
while (x.readyState!=4) {WSH.Sleep(50)}; |
|
|
|
var info = JSON.parse(x.responseText); |
|
TITLE = info.title; |
|
} |
|
TITLE = decodeURI(encodeURI(TITLE).replace(/%C3%AD/g,'%69').replace(/%C3%A9/g,'%65').replace(/%C3%A1/g,'%61').replace(/%C3%B3|%C3%B6|%C5%91/g,'%6F').replace(/%C3%BA|%C3%BC|%C5%B1/g,'%75').replace(/%C3%8D/g,'%49').replace(/%C3%89/g,'%45').replace(/%C3%81/g,'%41').replace(/%C3%93|%C3%96|%C5%90/g,'%4F').replace(/%C3%9A|%C3%9C|%C5%B0/g,'%55')).replace(/[^a-z0-9.\-]/gi, '_'); |
|
if (!TITLE) TITLE = ID; |
|
|
|
x.open('GET',String('\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6E\x61\x76\x61\x2E\x68\x75\x2F\x77\x70\x2D\x63\x6F\x6E\x74\x65\x6E\x74\x2F\x70\x6C\x75\x67\x69\x6E\x73\x2F\x68\x6D\x73\x2D\x6E\x61\x76\x61\x2F\x69\x6E\x74\x65\x72\x66\x61\x63\x65\x2F\x67\x65\x74\x50\x6C\x61\x79\x65\x72\x54\x6F\x6B\x65\x6E\x2E\x70\x68\x70\x3F\x70\x72\x65\x66\x69\x78\x3D\x32\x26\x76\x69\x64\x3D')+ID,true); |
|
x.setRequestHeader('User-Agent',UA); |
|
x.send(''); |
|
while (x.readyState!=4) {WSH.Sleep(50)}; |
|
|
|
var res = JSON.parse(x.responseText); |
|
WSH.Echo(String('\x68\x74\x74\x70\x73\x3A\x2F\x2F\x73\x74\x72\x6C\x62\x2E\x6E\x61\x76\x61\x2E\x68\x75\x2F\x6C\x62\x73\x2F\x6E\x61\x76\x61\x68\x75\x73\x2F\x5F\x64\x65\x66\x69\x6E\x73\x74\x5F\x2F\x61\x6D\x6C\x73\x74\x3A')+res.vid+String('\x3F\x74\x79\x70\x65\x3D\x6D\x33\x75\x38\x26\x73\x65\x73\x73\x69\x64\x3D')+res.token+'|'+ID+'|'+TITLE+'|'+SUB); |
sajnos ez már nem használható, mert a nava mindenre DRM protectiont rakott