mirror of
https://github.com/adef17286-sudo/NPO_start_DL.git
synced 2025-12-19 20:52:16 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 601a5d335e | |||
| 298f1179f7 | |||
| b3e4842a6d | |||
| 43a20d9306 | |||
| ac2ee4b6a8 | |||
| 8cf6a91a80 | |||
| f3121bc382 |
18
DL.py
18
DL.py
@ -15,12 +15,14 @@ from pywidevine.pssh import PSSH
|
|||||||
|
|
||||||
def run_npo_get_output(link):
|
def run_npo_get_output(link):
|
||||||
try:
|
try:
|
||||||
p = subprocess.run([sys.executable, 'NPO.py', link],
|
script_dir = Path(sys.argv[0]).parent.resolve()
|
||||||
|
npo_path = script_dir / "NPO.py"
|
||||||
|
p = subprocess.run([sys.executable, str(npo_path), link],
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
text=True)
|
text=True)
|
||||||
return p.stdout or "", p.stderr or "", p.returncode
|
return p.stdout or "", p.stderr or "", p.returncode
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[!] Failed to run NPO.py:", e)
|
print("[!] Failed to run NPO:", e)
|
||||||
return "", str(e), 1
|
return "", str(e), 1
|
||||||
|
|
||||||
|
|
||||||
@ -163,12 +165,22 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
all_keypairs.extend(keys)
|
all_keypairs.extend(keys)
|
||||||
|
|
||||||
|
script_dir = Path(sys.argv[0]).parent.resolve()
|
||||||
|
if sys.platform == "win32":
|
||||||
|
n_m3u8dl_re_path = script_dir / "N_m3u8DL-RE.exe"
|
||||||
|
mp4decrypt_path = script_dir / "mp4decrypt.exe"
|
||||||
|
else:
|
||||||
|
n_m3u8dl_re_path = script_dir / "N_m3u8DL-RE"
|
||||||
|
mp4decrypt_path = script_dir / "mp4decrypt"
|
||||||
|
|
||||||
# Build command for N_m3u8dl-re
|
# Build command for N_m3u8dl-re
|
||||||
cmd = ["N_m3u8dl-re", mpd_url]
|
cmd = [str(n_m3u8dl_re_path), mpd_url]
|
||||||
for keypair in all_keypairs:
|
for keypair in all_keypairs:
|
||||||
cmd += ["--key", keypair]
|
cmd += ["--key", keypair]
|
||||||
|
|
||||||
# Append fixed options
|
# Append fixed options
|
||||||
|
cmd += ["--decryption-engine", "MP4DECRYPT"]
|
||||||
|
cmd += ["--decryption-binary-path", str(mp4decrypt_path)]
|
||||||
cmd += ["-sv", "best", "-sa", "best", "-M", "mkv"]
|
cmd += ["-sv", "best", "-sa", "best", "-M", "mkv"]
|
||||||
|
|
||||||
print("\n[+] Running command:")
|
print("\n[+] Running command:")
|
||||||
|
|||||||
28
get.bat
28
get.bat
@ -1,28 +0,0 @@
|
|||||||
@echo off
|
|
||||||
echo Downloading Bento4 for Windows...
|
|
||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { $page = Invoke-WebRequest -Uri 'https://www.bento4.com/downloads/'; $link = ($page.Links | Where-Object { $_.href -like '*.zip' -and $_.outerText -like '*Binaries for Windows*' } | Select-Object -ExpandProperty href -First 1); if ($link) { $uri = New-Object System.Uri('https://www.bento4.com/downloads/'); $zipUrl = New-Object System.Uri($uri, $link); Write-Host ('Downloading from: ' + $zipUrl.AbsoluteUri); Invoke-WebRequest -Uri $zipUrl.AbsoluteUri -OutFile 'mp4decrypt.zip'; Write-Host 'Successfully downloaded to mp4decrypt.zip'; } else { Write-Host 'Could not find a suitable download link.'; exit 1; } } catch { Write-Host ('An error occurred: ' + $_.Exception.Message); exit 1; }"
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Extracting mp4decrypt.exe...
|
|
||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { Expand-Archive -Path 'mp4decrypt.zip' -DestinationPath '.' -Force; $extractedFolder = Get-ChildItem -Path '.' -Directory | Where-Object { $_.Name -like 'Bento4-SDK*' }; if ($extractedFolder) { $mp4decryptPath = Join-Path -Path $extractedFolder.FullName -ChildPath 'bin\mp4decrypt.exe'; if (Test-Path $mp4decryptPath) { Move-Item -Path $mp4decryptPath -Destination '.'; Write-Host 'Successfully extracted mp4decrypt.exe'; } else { Write-Host 'mp4decrypt.exe not found in the extracted folder.'; } Remove-Item -Path $extractedFolder.FullName -Recurse -Force; } else { Write-Host 'Could not find the extracted folder.'; } } catch { Write-Host ('An error occurred during extraction: ' + $_.Exception.Message); }"
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Cleaning up...
|
|
||||||
del mp4decrypt.zip
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Downloading N_m3u8DL-RE for Windows...
|
|
||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { $releaseInfo = Invoke-RestMethod -Uri 'https://api.github.com/repos/nilaoda/N_m3u8DL-RE/releases/latest'; $asset = $releaseInfo.assets | Where-Object { $_.name -like '*win-x64*' } | Select-Object -First 1; if ($asset) { Write-Host ('Downloading from: ' + $asset.browser_download_url); Invoke-WebRequest -Uri $asset.browser_download_url -OutFile 'N_m3u8DL-RE.zip'; Write-Host 'Successfully downloaded to N_m3u8DL-RE.zip'; } else { Write-Host 'Could not find a suitable download link for N_m3u8DL-RE.'; exit 1; } } catch { Write-Host ('An error occurred: ' + $_.Exception.Message); exit 1; }"
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Extracting N_m3u8DL-RE...
|
|
||||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { Expand-Archive -Path 'N_m3u8DL-RE.zip' -DestinationPath '.' -Force; Write-Host 'Successfully extracted N_m3u8DL-RE'; } catch { Write-Host ('An error occurred during extraction: ' + $_.Exception.Message); }"
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Cleaning up...
|
|
||||||
del N_m3u8DL-RE.zip
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Done.
|
|
||||||
echo Press any key to exit.
|
|
||||||
pause > nul
|
|
||||||
Loading…
x
Reference in New Issue
Block a user