Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO off
- ::Set your group name below:
- SET group=YourGroup
- ECHO.
- ECHO Making sure there are no leftover temp files...
- ECHO.
- DEL output.vtt
- DEL output.srt
- DEL output.ts
- ECHO.
- ECHO If this is your first time using this script, please make sure streamlink is installed,
- ECHO and wget.exe, mkvmerge.exe and subtitleedit.exe are in the same directory as this batch file.
- ECHO.
- SET /p m3u8=Playlist (m3u8) url:
- ECHO.
- ECHO Detecting max resolution . . .
- IF "%m3u8%"=="%m3u8:1080p=%" (
- SET res=720
- ) ELSE (
- SET res=1080
- )
- SET "m3u8=%m3u8:16x9-720p.m3u8=16x9-1080p.m3u8%"
- SET "m3u8=%m3u8:m1080-16x9-hls-400-2500k.m3u8=m1080-16x9-hls-6500k.m3u8%"
- SET "m3u8=%m3u8:m1080-16x9-hls-1200k.m3u8=m1080-16x9-hls-6500k.m3u8%"
- SET "m3u8=%m3u8:m1080-16x9-hls-2500k.m3u8=m1080-16x9-hls-6500k.m3u8%"
- SET "m3u8=%m3u8:720p-720p-3000k.m3u8=1080p.m3u8%"
- SET "m3u8=%m3u8:720p-540p-2000k.m3u8=1080p.m3u8%"
- ECHO.
- ECHO %m3u8%
- ECHO.
- IF "%m3u8%"=="%m3u8:16x9=%" (
- SET aspect=4x3
- ) ELSE (
- SET aspect=16x9
- )
- IF "%aspect%"=="16x9" (
- SET shortm3u8=%m3u8:*_=%
- ) ELSE (
- SET shortm3u8=%m3u8:*4x3/=%
- )
- ECHO shortened m3u8: %shortm3u8%
- ECHO.
- SET season=%shortm3u8:~4,1%
- SET season=0%season%
- SET "season=%season:~-2%"
- SET epnum=%shortm3u8:~5,2%
- SET epnum=0%epnum%
- SET "epnum=%epnum:~-2%"
- SET ident=%shortm3u8:~0,7%
- ECHO ident: %ident%
- IF "%ident:~0,4%"=="arur" (SET series=Arthur)
- IF "%ident:~0,4%"=="bobl" (SET series=Bob.the.Builder)
- IF "%ident:~0,4%"=="caiu" (SET series=Caillu)
- IF "%ident:~0,4%"=="cith" (SET series=The.Cat.in.the.Hat.Knows.a.Lot.About.That)
- IF "%ident:~0,4%"=="cuge" (SET series=Curious.George)
- IF "%ident:~0,4%"=="cybr" (SET series=Cyberchase)
- IF "%ident:~0,4%"=="dins" (SET series=Dinosaur.Train)
- IF "%ident:~0,4%"=="dsna" (SET series=Design.Squad)
- IF "%ident:~0,4%"=="dtig" (SET series=Daniel.Tigers.Neighborhood)
- IF "%ident:~0,4%"=="elco" (SET series=The.Electric.Company)
- IF "%ident:~0,4%"=="mspe" (SET series=Martha.Speaks)
- IF "%ident:~0,4%"=="mstr" (SET series=Mister.Rogers)
- IF "%ident:~0,4%"=="ncat" (SET series=Nature.Cat)
- IF "%ident:~0,4%"=="odds" (SET series=Odd.Squad)
- IF "%ident:~0,4%"=="pcat" (SET series=Peg.plus.Cat)
- IF "%ident:~0,4%"=="pipe" (SET series=Pinkalicious.and.Peterrific)
- IF "%ident:~0,4%"=="rjgo" (SET series=Ready.Jet.Go)
- IF "%ident:~0,4%"=="sbub" (SET series=Splash.and.Bubbles)
- IF "%ident:~0,4%"=="sesa" (SET series=Sesame.Street)
- IF "%ident:~0,4%"=="sgir" (SET series=SciGirls)
- IF "%ident:~0,4%"=="sisk" (SET series=Sid.the.Science.Kid)
- IF "%ident:~0,4%"=="swhy" (SET series=Super.Why)
- IF "%ident:~0,4%"=="worg" (SET series=WordGirl)
- IF "%ident:~0,4%"=="wowo" (SET series=WordWorld)
- ECHO.
- ECHO Max Resolution: %res%p
- ECHO.
- ECHO Aspect Ratio: %aspect%
- ECHO.
- ECHO Series Name: %series%
- ECHO.
- ECHO Season Number: %season%
- ECHO.
- ECHO Episode Number: %epnum%
- ECHO.
- SET /p eptitle=Episode title:
- SET "eptitle=%eptitle: =.%"
- SET /p subs=Subtitles (vtt) url (enter 0 for none):
- ECHO.
- IF %subs%==0 (
- GOTO :skipsubs
- ) ELSE (
- ECHO Subtitles detected . . .
- )
- ECHO.
- ECHO Removing https from vtt url . . .
- ECHO.
- SET "subs=%subs:https=http%"
- ECHO Subtitles (vtt) url: %subs%
- ECHO.
- ECHO Downloading subtitles . . .
- ECHO.
- WGET "%subs%" -O output.vtt
- ECHO.
- ECHO Converting subtitles . . .
- ECHO.
- SUBTITLEEDIT /convert output.vtt srt
- :SKIPSUBS
- ECHO.
- ECHO.
- ECHO Downloading video and audio . . .
- ECHO.
- STREAMLINK %m3u8% best -o output.ts
- ECHO.
- IF %subs%==0 (
- GOTO :MERGENOSUBS
- ) ELSE (
- ECHO Merging files . . .
- )
- ECHO.
- MKVMERGE -o output.mkv --language 1:eng output.ts --default-track 0:0 --language 0:eng output.srt
- :FINISH
- IF "%m3u8%"=="%m3u8:1080p=%" (
- SET res=720
- ) ELSE (
- SET res=1080
- )
- REN output.mkv %series%.S%season%E%epnum%.%eptitle%.%res%p.PBSK.WEB-DL.AAC2.0.H.264-%group%.mkv
- ECHO.
- ECHO Continuing will delete temp files . . .
- ECHO.
- PAUSE
- DEL output.vtt
- DEL output.srt
- DEL output.ts
- EXIT /B
- :MERGENOSUBS
- ECHO.
- ECHO Merging files . . .
- ECHO.
- MKVMERGE -o output.mkv --language 1:eng output.ts
- GOTO :FINISH
Add Comment
Please, Sign In to add comment