[BUG] TypeError: Cannot read property '1' of null (Funimation Changed Their Streams/API) #54

Closed
opened 2021-04-24 16:23:55 +00:00 by XxUnkn0wnxX · 3 comments
XxUnkn0wnxX commented 2021-04-24 16:23:55 +00:00 (Migrated from github.com)

** Main info: **

Script version: 4.7.0-beta.2
Show ID: 1394901
Episode ID: 5

** Additional Info: **

i think funimation changed their playlist data again...

[#1394901] Vivy -Fluorite Eye's Song- (2021)
[0001] Vivy -Fluorite Eye's Song- - #01 My Code – To Make Everyone Happy With My Singing (00:26:11) [HD1080, Japanese]
[0002] Vivy -Fluorite Eye's Song- - #02 Quarter Note – The Beginning of the One Hundred-Year Journey (00:22:44) [HD1080, Japanese]
[0003] Vivy -Fluorite Eye's Song- - #03 A Tender Moon Tempo - A Pleasant Chat with the Stars (23:39) [HD1080, Japanese]
[0004] Vivy -Fluorite Eye's Song- - #04 Ensemble for Polaris - Our Promise (00:00:01) [HD1080, Japanese]
[0005] Vivy -Fluorite Eye's Song- - #05 Sing My Pleasure - To Make You Smile (00:23:40) [HD1080, Japanese] (selected)

[INFO] Selected Episodes: 0005

[INFO] Vivy -Fluorite Eye's Song- - S1E05 - Sing My Pleasure - To Make You Smile
[INFO] Available streams (Non-Encrypted):
[#1449163] Japanese [Simulcast] (selected)
/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:413
        let plLayerId = parseInt(s.uri.match(/_Layer(\d+)\.m3u8/)[1]);
                                                                 ^

TypeError: Cannot read property '1' of null
    at downloadStreams (/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:413:66)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async getEpisode (/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:368:13)
    at async getShow (/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:251:13)

however, you can still DL with ffmpeg but its a pain..

ffmpeg -headers $'Cookie: src_token=YOURTOKENHERE; \r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0' -i "FULL URL to .m3u8 WITH KEYPAIR" -c copy -bsf:a aac_adtstoasc output.mkv -v trace

funimation breaks up their streams into two m3u8 files now, one for video & the other is audio track JPN, ENG etc..

also their playerID is random every time depending on the show/EP for EP 5 for Vivy was player/1449163 (experienceID)

not sure how m3u8 is grabbed. the only way I could see it is in the network tab once the video actually loaded. cannot find it anywhere on the page anymore..

Eg Video File: https://vmfst-api.prd.funimationsvc.com/FunimationStoreFront/V2272753/009a3856-bde3-40d2-b065-b7bf4bc47fdestrnv-hl154_streaming_video_1920_1080_7800000_index.m3u8
Audio File: https://vmfst-api.prd.funimationsvc.com/FunimationStoreFront/V2272753/009a3856-bde3-40d2-b065-b7bf4bc47fdestrna-hl102_streaming_audio_2_jpn_composite_aac_ja_index.m3u8
Subs: https://d33et77evd9bgg.cloudfront.net/FunimationStoreFront/V2272753/009a3856-bde3-40d2-b065-b7bf4bc47fde_english_full.vtt

keypair is hidden for obvious reasons...

& as for subs you can look for .srt or .vtt in the script section where col-md-10 video-player-container
is located..
hope a fix is added in... to detect the new streams...

<!-- Please fill in the placeholders.--> ** Main info: ** Script version: 4.7.0-beta.2 Show ID: 1394901 Episode ID: 5 ** Additional Info: ** i think funimation changed their playlist data again... ``` [#1394901] Vivy -Fluorite Eye's Song- (2021) [0001] Vivy -Fluorite Eye's Song- - #01 My Code – To Make Everyone Happy With My Singing (00:26:11) [HD1080, Japanese] [0002] Vivy -Fluorite Eye's Song- - #02 Quarter Note – The Beginning of the One Hundred-Year Journey (00:22:44) [HD1080, Japanese] [0003] Vivy -Fluorite Eye's Song- - #03 A Tender Moon Tempo - A Pleasant Chat with the Stars (23:39) [HD1080, Japanese] [0004] Vivy -Fluorite Eye's Song- - #04 Ensemble for Polaris - Our Promise (00:00:01) [HD1080, Japanese] [0005] Vivy -Fluorite Eye's Song- - #05 Sing My Pleasure - To Make You Smile (00:23:40) [HD1080, Japanese] (selected) [INFO] Selected Episodes: 0005 [INFO] Vivy -Fluorite Eye's Song- - S1E05 - Sing My Pleasure - To Make You Smile [INFO] Available streams (Non-Encrypted): [#1449163] Japanese [Simulcast] (selected) /Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:413 let plLayerId = parseInt(s.uri.match(/_Layer(\d+)\.m3u8/)[1]); ^ TypeError: Cannot read property '1' of null at downloadStreams (/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:413:66) at processTicksAndRejections (node:internal/process/task_queues:94:5) at async getEpisode (/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:368:13) at async getShow (/Users/Admin/Apps/Animie/anidl/funimation-downloader-nx/funi.js:251:13) ``` however, you can still DL with ffmpeg but its a pain.. `ffmpeg -headers $'Cookie: src_token=YOURTOKENHERE; \r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0' -i "FULL URL to .m3u8 WITH KEYPAIR" -c copy -bsf:a aac_adtstoasc output.mkv -v trace ` funimation breaks up their streams into two m3u8 files now, one for video & the other is audio track JPN, ENG etc.. also their playerID is random every time depending on the show/EP for EP 5 for Vivy was player/1449163 (experienceID) not sure how m3u8 is grabbed. the only way I could see it is in the network tab once the video actually loaded. cannot find it anywhere on the page anymore.. Eg Video File: `https://vmfst-api.prd.funimationsvc.com/FunimationStoreFront/V2272753/009a3856-bde3-40d2-b065-b7bf4bc47fdestrnv-hl154_streaming_video_1920_1080_7800000_index.m3u8` Audio File: `https://vmfst-api.prd.funimationsvc.com/FunimationStoreFront/V2272753/009a3856-bde3-40d2-b065-b7bf4bc47fdestrna-hl102_streaming_audio_2_jpn_composite_aac_ja_index.m3u8` Subs: `https://d33et77evd9bgg.cloudfront.net/FunimationStoreFront/V2272753/009a3856-bde3-40d2-b065-b7bf4bc47fde_english_full.vtt` keypair is hidden for obvious reasons... & as for subs you can look for .srt or .vtt in the script section where `col-md-10 video-player-container` is located.. hope a fix is added in... to detect the new streams...
izu-co commented 2021-05-03 12:36:43 +00:00 (Migrated from github.com)

@XxUnkn0wnxX From the current codebase it should be possible to download things again.

@XxUnkn0wnxX From the current codebase it should be possible to download things again.
XxUnkn0wnxX commented 2021-05-03 18:37:21 +00:00 (Migrated from github.com)

@AnAppleforlife seems like there is an issue with mkvmerge

❯ funi --search "Mars Red"

=== Funimation Downloader NX 4.8.0-beta.1 ===

[INFO] Search Results:
[#1393188] MARS RED
[#37057] Snow White with the Red Hair
[#929973] MOBILE SUIT GUNDAM THE ORIGIN Advent of the Red Comet
[INFO] Total shows found: 3

❯ funi -s 1393188 --mks -e 5

=== Funimation Downloader NX 4.8.0-beta.1 ===

[#1393188] MARS RED (2021)
[0001] MARS RED - #01 Dawn (23:40) [HD1080, Japanese, English]
[0002] MARS RED - #02 Till Death Do Us Part (23:40) [HD1080, Japanese, English]
[0003] MARS RED - #03 His Dream (00:23:40) [HD1080, English, Japanese]
[0004] MARS RED - #04 Unknown Song (00:23:40) [HD1080, English, Japanese]
[0005] MARS RED - #05 Persona Non Grata (00:23:39) [SD540, Japanese, English] (selected)

[INFO] Selected Episodes: 0005

[INFO] MARS RED - S1E05 - Persona Non Grata
[INFO] Available streams (Non-Encrypted):
[#1461750] Japanese [Simulcast] 
[#1461734] English [Simulcast] (selected)
[INFO] Servers available:
	vmfst-api.prd.funimationsvc.com
[INFO] Available qualities:
	 1: 234p (320KiB/s)
	 2: 360p (544KiB/s)
	 3: 432p (849KiB/s)
	 4: 432p (1271KiB/s)
	 5: 540p (2046KiB/s)
	 6: 720p (3231KiB/s)
	 7: 720p (4699KiB/s)
	 8: 1080p (6308KiB/s)
	 9: 1080p (8104KiB/s)
[INFO] Selected layer: 9 (1080p) @ vmfst-api.prd.funimationsvc.com
[INFO] Stream URL: https://vmfst-api.prd.funimationsvc.com/FunimationStoreFront/V2272673/1197e27b-f3db-4c7f-bb7c-8b731cacc6b3strnv-hl154_streaming_video_1920_1080_7800000_index.m3u8?Key-Pair-Id=APKAIHNXECY27H4O6NIA&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMzNldDc3ZXZkOWJnZy5jbG91ZGZyb250Lm5ldC9GdW5pbWF0aW9uU3RvcmVGcm9udC9WMjI3MjY3My8qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjIwMDcwNDcxfX19XX0_&Signature=PNQakzDMtsforEnJKg4uNIXdkM511jUNZuV5zp~WfjYoAUD0JFSbRYrGyTJZbzDqozfkpi6bu2eWn-pmZvZdrE9RM2LMLwxy~rkz8YGNLmdVkiiq6gdJZhzU~Cm34KxmslWp2ev4wRydNzPazaHgz~~3KvEHJVaMKftRMCHVkVhWyms2~N2pBmm4UgRNPAZacf8TCoznzQCc4T-As4kxDjKRe3roOqF1tXpyv2xBAelzHeRVyrqWpL4ud~d9zLcM64yyfS59D4Kw26fnfcfmT0ddfBdXv1DS47PPSNMOWAyS-qg-a3vhIVLCIccfhfpBrTJs~F~lz~iU3HbXoxr4CA__&rt=1419960
[INFO] Output filename: [Funimation] MARS RED - 05 [1080p].ts
[INFO] Downloaded 3% (30052kb/935838kb)
[INFO] Downloaded 8% (77005kb/935838kb)
[INFO] Downloaded 13% (122892kb/935838kb)
[INFO] Downloaded 18% (169524kb/935838kb)
[INFO] Downloaded 23% (216031kb/935838kb)
[INFO] Downloaded 28.000000000000004% (262070kb/935838kb)
[INFO] Downloaded 33% (308877kb/935838kb)
[INFO] Downloaded 38% (354559kb/935838kb)
[INFO] Downloaded 43% (400061kb/935838kb)
[INFO] Downloaded 48% (445999kb/935838kb)
[INFO] Downloaded 53% (491868kb/935838kb)
[INFO] Downloaded 56.99999999999999% (537676kb/935838kb)
[INFO] Downloaded 62% (583958kb/935838kb)
[INFO] Downloaded 67% (630420kb/935838kb)
[INFO] Downloaded 72% (676587kb/935838kb)
[INFO] Downloaded 77% (722300kb/935838kb)
[INFO] Downloaded 82% (767788kb/935838kb)
[INFO] Downloaded 87% (813020kb/935838kb)
[INFO] Downloaded 92% (858252kb/935838kb)
[INFO] Downloaded 97% (903788kb/935838kb)
[INFO] Finished /Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p]
[INFO] Finished /Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p].en

> "mkvmerge" @"/Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p].json"
mkvmerge v56.1.0 ('My Friend') 64-bit
Error: '' is not a valid IETF BCP 47/RFC 5646 language tag in '--language 1:'. Additional information from the parser: The value does not adhere to the general structure of IETF BCP 47/RFC 5646 language tags.
node:child_process:707
    err = new Error(msg);
          ^

Error: Command failed: "/usr/local/bin/mkvmerge" @"/Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p].json"
    at checkExecSyncError (node:child_process:707:11)
    at Object.execSync (node:child_process:744:15)
    at Object.exec (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/node_modules/sei-helper/src/main.js:174:30)
    at downloadStreams (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/funi.js:799:14)
    at async getEpisode (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/funi.js:375:13)
    at async getShow (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/funi.js:252:13) {
  status: 2,
  signal: null,
  output: [ null, null, null ],
  pid: 39162,
  stdout: null,
  stderr: null
}

mkvmerge v56.1.0 ('My Friend') 64-bit

@AnAppleforlife seems like there is an issue with mkvmerge ``` ❯ funi --search "Mars Red" === Funimation Downloader NX 4.8.0-beta.1 === [INFO] Search Results: [#1393188] MARS RED [#37057] Snow White with the Red Hair [#929973] MOBILE SUIT GUNDAM THE ORIGIN Advent of the Red Comet [INFO] Total shows found: 3 ❯ funi -s 1393188 --mks -e 5 === Funimation Downloader NX 4.8.0-beta.1 === [#1393188] MARS RED (2021) [0001] MARS RED - #01 Dawn (23:40) [HD1080, Japanese, English] [0002] MARS RED - #02 Till Death Do Us Part (23:40) [HD1080, Japanese, English] [0003] MARS RED - #03 His Dream (00:23:40) [HD1080, English, Japanese] [0004] MARS RED - #04 Unknown Song (00:23:40) [HD1080, English, Japanese] [0005] MARS RED - #05 Persona Non Grata (00:23:39) [SD540, Japanese, English] (selected) [INFO] Selected Episodes: 0005 [INFO] MARS RED - S1E05 - Persona Non Grata [INFO] Available streams (Non-Encrypted): [#1461750] Japanese [Simulcast] [#1461734] English [Simulcast] (selected) [INFO] Servers available: vmfst-api.prd.funimationsvc.com [INFO] Available qualities: 1: 234p (320KiB/s) 2: 360p (544KiB/s) 3: 432p (849KiB/s) 4: 432p (1271KiB/s) 5: 540p (2046KiB/s) 6: 720p (3231KiB/s) 7: 720p (4699KiB/s) 8: 1080p (6308KiB/s) 9: 1080p (8104KiB/s) [INFO] Selected layer: 9 (1080p) @ vmfst-api.prd.funimationsvc.com [INFO] Stream URL: https://vmfst-api.prd.funimationsvc.com/FunimationStoreFront/V2272673/1197e27b-f3db-4c7f-bb7c-8b731cacc6b3strnv-hl154_streaming_video_1920_1080_7800000_index.m3u8?Key-Pair-Id=APKAIHNXECY27H4O6NIA&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMzNldDc3ZXZkOWJnZy5jbG91ZGZyb250Lm5ldC9GdW5pbWF0aW9uU3RvcmVGcm9udC9WMjI3MjY3My8qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjIwMDcwNDcxfX19XX0_&Signature=PNQakzDMtsforEnJKg4uNIXdkM511jUNZuV5zp~WfjYoAUD0JFSbRYrGyTJZbzDqozfkpi6bu2eWn-pmZvZdrE9RM2LMLwxy~rkz8YGNLmdVkiiq6gdJZhzU~Cm34KxmslWp2ev4wRydNzPazaHgz~~3KvEHJVaMKftRMCHVkVhWyms2~N2pBmm4UgRNPAZacf8TCoznzQCc4T-As4kxDjKRe3roOqF1tXpyv2xBAelzHeRVyrqWpL4ud~d9zLcM64yyfS59D4Kw26fnfcfmT0ddfBdXv1DS47PPSNMOWAyS-qg-a3vhIVLCIccfhfpBrTJs~F~lz~iU3HbXoxr4CA__&rt=1419960 [INFO] Output filename: [Funimation] MARS RED - 05 [1080p].ts [INFO] Downloaded 3% (30052kb/935838kb) [INFO] Downloaded 8% (77005kb/935838kb) [INFO] Downloaded 13% (122892kb/935838kb) [INFO] Downloaded 18% (169524kb/935838kb) [INFO] Downloaded 23% (216031kb/935838kb) [INFO] Downloaded 28.000000000000004% (262070kb/935838kb) [INFO] Downloaded 33% (308877kb/935838kb) [INFO] Downloaded 38% (354559kb/935838kb) [INFO] Downloaded 43% (400061kb/935838kb) [INFO] Downloaded 48% (445999kb/935838kb) [INFO] Downloaded 53% (491868kb/935838kb) [INFO] Downloaded 56.99999999999999% (537676kb/935838kb) [INFO] Downloaded 62% (583958kb/935838kb) [INFO] Downloaded 67% (630420kb/935838kb) [INFO] Downloaded 72% (676587kb/935838kb) [INFO] Downloaded 77% (722300kb/935838kb) [INFO] Downloaded 82% (767788kb/935838kb) [INFO] Downloaded 87% (813020kb/935838kb) [INFO] Downloaded 92% (858252kb/935838kb) [INFO] Downloaded 97% (903788kb/935838kb) [INFO] Finished /Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p] [INFO] Finished /Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p].en > "mkvmerge" @"/Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p].json" mkvmerge v56.1.0 ('My Friend') 64-bit Error: '' is not a valid IETF BCP 47/RFC 5646 language tag in '--language 1:'. Additional information from the parser: The value does not adhere to the general structure of IETF BCP 47/RFC 5646 language tags. node:child_process:707 err = new Error(msg); ^ Error: Command failed: "/usr/local/bin/mkvmerge" @"/Users/ADMIN/Downloads/AppDL/funi/[Funimation] MARS RED - 05 [1080p].json" at checkExecSyncError (node:child_process:707:11) at Object.execSync (node:child_process:744:15) at Object.exec (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/node_modules/sei-helper/src/main.js:174:30) at downloadStreams (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/funi.js:799:14) at async getEpisode (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/funi.js:375:13) at async getShow (/Users/ADMIN/Apps/Animie/anidl/funimation-downloader-nx/funi.js:252:13) { status: 2, signal: null, output: [ null, null, null ], pid: 39162, stdout: null, stderr: null } ``` mkvmerge v56.1.0 ('My Friend') 64-bit
izu-co commented 2021-05-03 18:49:27 +00:00 (Migrated from github.com)

@XxUnkn0wnxX I've opened a new pull request with a better download system.

I think there is an issue with the mkv merge syntax and to be honest, I don't know anything about mkv merge.

@XxUnkn0wnxX I've opened a new pull request with a better download system. I think there is an issue with the mkv merge syntax and to be honest, I don't know anything about mkv merge.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Creepso/multi-downloader-nx#54
No description provided.