jaimeMF / youtube-dl-api-server

A youtube-dl REST API server
https://youtube-dl-api-server.readthedocs.org/
The Unlicense
364 stars 212 forks source link

add a 'listen' entrypoint to redirect to an audio only url #48

Closed eadmaster closed 8 years ago

eadmaster commented 8 years ago

get_result was also changed a bit...

jaimeMF commented 8 years ago

Two things:

@route_api('listen')
def listen():
    args = dict(request.args)
    args.setdefault('format', 'bestaudio')
    return redirect(url_for('.play', **args))
eadmaster commented 8 years ago

I've chosen mp4 because probably it is more compatible with older audio players that may lack opus support.

jaimeMF commented 8 years ago

I've chosen mp4 because probably it is more compatible with older audio players that may lack opus support.

If a player only supports m4a, you should specify the format.

eadmaster commented 8 years ago

Allrighty, i just have to add &format=m4a to my urls to get the audio track only...