This commit is contained in:
ArabCoders 2024-03-28 22:55:24 +03:00
parent 46e7d28fc8
commit 5d57ae25ab
4 changed files with 8 additions and 9 deletions

View file

@ -4,7 +4,6 @@ from datetime import datetime, timezone
from email.utils import formatdate
import json
from sqlite3 import Connection
from Utils import calcDownloadPath
from Config import Config
from Download import Download
from ItemDTO import ItemDTO

View file

@ -11,7 +11,6 @@ from Utils import ObjectSerializer, Notifier
from aiohttp import web, client
from aiohttp.web import Request, Response
from Webhooks import Webhooks
from Download import Download
from player.M3u8 import M3u8
from player.Segments import Segments
import socketio
@ -416,11 +415,16 @@ class Main:
if not file:
raise web.HTTPBadRequest(reason='file is required.')
return web.Response(
text=await M3u8(url=f"{self.config.url_host}{self.config.url_prefix}").make_stream(
try:
text = await M3u8(url=f"{self.config.url_host}{self.config.url_prefix}").make_stream(
download_path=self.config.download_path,
file=file
),
)
except Exception as e:
return web.HTTPNotFound(reason=str(e))
return web.Response(
text=text,
headers={
'Content-Type': 'application/x-mpegURL',
'Cache-Control': 'no-cache',

View file

@ -2,7 +2,6 @@ import asyncio
import hashlib
import logging
import os
import subprocess
import tempfile
from Utils import calcDownloadPath

View file

@ -4,11 +4,8 @@ Python wrapper for ffprobe command line tool. ffprobe must exist in the path.
import asyncio
import functools
import json
import logging
import operator
import os
import pipes
import subprocess
class FFProbeError(Exception):