简体   繁体   中英

Serving media file to podcast.app (iOS/MacOS) for download

I'm trying to create a simple podcast hosting web server with flask.

Streaming media files from the server works beautifully. However whenever I try and download the media for offline viewing my podcast app throws "Download error".

I've tried all sorts of headers and responses.

End point I'm using with relevant code (I hardcoded the filename for testing):

import os
import logging

from streamlink.exceptions import (PluginError)
from flask import Flask, redirect, abort, request
from flask import send_from_directory

def run_server(host, port, file_dir):
    @app.route('/media', methods=['GET'])
        def media():
            return send_from_directory(file_dir, '6TfLVL5GeE4.mp4')

    app.run(host=host, port=port, debug=True)

Podcast.app error log states:

Download failed due to error: Invalid asset: The original extension and resolved extension were not playable for episode url Optional(http://10.0.0.115:8084/media?id=6TfLVL5GeE4&provider=tw).

I can't for the life of me figure why it would fail for downloading but stream perfectly fine.

Please help!

Found out that you can not use parameters for a podcast feed url.

The url must include a filename.

For example: http://localhost/file.mp3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM