Jeeaaasus / youtube-dl

Automated yt-dlp Docker image
https://hub.docker.com/r/jeeaaasustest/youtube-dl/
MIT License
258 stars 33 forks source link

Downloading .mp3 not working #70

Closed JanHBade closed 2 years ago

JanHBade commented 2 years ago

Hello,

try to download only audio....

INFO:     192.168.42.50:62264 - "POST /download HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 364, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 212, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc
  File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
    raise exc
  File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 656, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 61, in app
    response = await func(request)
  File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 226, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 159, in run_endpoint_function
    return await dependant.call(**values)
  File "/app/webserver/youtube-dl.py", line 39, in download_url
    execute(f'{youtubedl_binary} \'{url}\' --config-location \'/config/args.conf\' {youtubedl_args_format}')
  File "/app/webserver/youtube-dl.py", line 18, in execute
    raise Exception(command, exit_code, output)
Exception: ('yt-dlp \'https://www.youtube.com/watch?v=zj010B0Gn1o\' --config-location \'/config/args.conf\' --format "((bv*[fps>30]/bv*)[height<=1080]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=1080]/(w[fps>30]/w)"', 1, '[youtube] zj010B0Gn1o: Downloading webpage\n[youtube] zj010B0Gn1o: Downloading android player API JSON\n[youtube] zj010B0Gn1o: Downloading player 0cd11746\n[info] zj010B0Gn1o: Downloading 1 format(s): 303+251\n[download] Destination: /downloads/Trupen 2/They are 374.74% better than inserters!.f303.webm\n[download] Download completed\n[download] Destination: /downloads/Trupen 2/They are 374.74% better than inserters!.f251.webm\n[download] Download completed\n[Merger] Merging formats into "/downloads/Trupen 2/They are 374.74% better than inserters!.mp3"\nERROR: Postprocessing:   Stream #1:0 -> #0:1 (copy)\n')

Config:

### This is where all global youtube-dl execution options are entered. it is totally OK to leave default.
### Check the github for help if needed: https://github.com/Jeeaaasus/youtube-dl/blob/master/README.md#configure-youtube-dl

## args
--output '/downloads/%(uploader)s/%(title)s.%(ext)s'

## Geo Restriction
--geo-bypass

## Video Selection
--playlist-end '8'
--match-filter '!is_live'

## Download Options
--abort-on-unavailable-fragment
--playlist-reverse

## Filesystem Options
--windows-filenames
--no-part
--no-cache-dir

## Verbosity / Simulation Options
--no-progress

## Video Format Options
--merge-output-format 'mp3'

## Subtitle Options
#--sub-langs 'all,-live_chat'

## Post-Processing Options
#--embed-subs
#--embed-thumbnail
#--embed-metadata
#--convert-subs 'srt'

## SponsorBlock Options
#--sponsorblock-mark 'all'
Jeeaaasus commented 2 years ago

Hi @JanHBade :)

to download audio only and save as mp3 you need to use these arguments:

--extract-audio
--audio-format mp3

--merge-output-format 'mp3' is not needed.

I found this helpful guide Hopefully that works for you!

JanHBade commented 2 years ago

works thanks!