|
@@ -27,8 +27,8 @@ def fetch_info(url):
|
|
|
|
|
|
@app.route("/p", methods=["GET", "POST"])
|
|
@app.route("/p", methods=["GET", "POST"])
|
|
def p():
|
|
def p():
|
|
- video_id = request.args.get("videoId")
|
|
|
|
- format_id = request.args.get("formatId")
|
|
|
|
|
|
+ video_id = request.args.get("id")
|
|
|
|
+ format_id = request.args.get("fId")
|
|
if video_id and format_id:
|
|
if video_id and format_id:
|
|
info = fetch_info(url=f"https://www.youtube.com/watch?v={video_id}")
|
|
info = fetch_info(url=f"https://www.youtube.com/watch?v={video_id}")
|
|
if info:
|
|
if info:
|
|
@@ -59,7 +59,7 @@ def convert_dto(info):
|
|
"acodec") != "none" and item.get("vcodec"):
|
|
"acodec") != "none" and item.get("vcodec"):
|
|
format_id = item.get("format_id")
|
|
format_id = item.get("format_id")
|
|
if format_id:
|
|
if format_id:
|
|
- url = f"http://d2rueqse8qhuiu.cloudfront.net/p?videoId={info['display_id']}&formatId={format_id}",
|
|
|
|
|
|
+ url = f"http://d2rueqse8qhuiu.cloudfront.net/p?id={info['display_id']}&fId={format_id}",
|
|
formats.append({
|
|
formats.append({
|
|
"width": f"{item.get('width', 0)}",
|
|
"width": f"{item.get('width', 0)}",
|
|
"height": f"{item.get('height', 0)}",
|
|
"height": f"{item.get('height', 0)}",
|