Skip to content

Commit

Permalink
Merge pull request #135 from fireattack/master
Browse files Browse the repository at this point in the history
get offset properly even when it's only 1 or 2 digit
  • Loading branch information
Last-Order authored Sep 19, 2024
2 parents ad51618 + 8c03a85 commit 4748920
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/parsers/nico.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ export default class Parser {
const firstChunkFilename = firstChunkUrl.match(/^(.+ts)/)[1];
let offset;
if (firstChunkFilename === "0.ts") {
offset = downloader.m3u8.chunks[1].url.match(/(\d{3})\.ts/)[1];
offset = downloader.m3u8.chunks[1].url.match(/(\d{1,3})\.ts/)[1];
} else {
offset = downloader.m3u8.chunks[0].url.match(/(\d{3})\.ts/)[1];
offset = downloader.m3u8.chunks[0].url.match(/(\d{1,3})\.ts/)[1];
}
offset = offset.padStart(3, "0");
const suffix = downloader.m3u8.chunks[0].url.match(/\.ts(.+)/)[1];
const newChunkList = [];
let counter = 0;
Expand Down

0 comments on commit 4748920

Please sign in to comment.