Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsharp committed Oct 11, 2023
1 parent 7ca871c commit 42fdc6b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ app.get('/video/:videoId', async (req, res) => {
try {
const videoId = req.params.videoId;

console.log(videoId);

const MAX_QUALITY = 2160;
const ADAPTIVE_QUALITY = true;

Expand Down
2 changes: 1 addition & 1 deletion src/services/contentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CONTENT_DIRECTORY } from '..';
const getLocalFormats = async (videoId: string): Promise<VideoFormat[]> => {
const content = await fs.promises.readdir(CONTENT_DIRECTORY);

console.log(content.filter((file) => file.replace(/^([^.]+)\..*$/, '$1') === videoId));
console.log(content.filter((file) => file.includes(decodeURI(encodeURI(videoId)))));

const videoFile = content.find((file) => file.startsWith('cB') && file.includes('.ts'));
const playlistFile = content.find((file) => file.startsWith('cB') && file.includes('.m3u8'));
Expand Down
4 changes: 1 addition & 3 deletions src/services/streamService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const buildStream = (
}"\n\n${videoStreams
.map(
(stream) =>
`#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=${stream.bitrate},CODECS="${
stream.codec
}",RESOLUTION=${stream.resolution}${stream.hasAudio ? '' : ',AUDIO="audio"'}\n${stream.url}`
`#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=${stream.bitrate},CODECS="${stream.codec}",RESOLUTION=${stream.resolution},AUDIO="audio"\n${stream.url}`
)
.join('\n\n')}`;
};
Expand Down

0 comments on commit 42fdc6b

Please sign in to comment.