Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output file name is not what I expected #23267

Closed
821938089 opened this issue Nov 30, 2019 · 2 comments
Closed

Output file name is not what I expected #23267

821938089 opened this issue Nov 30, 2019 · 2 comments

Comments

@821938089
Copy link

@821938089 821938089 commented Nov 30, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.11.28
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[youtube] gYO1uk7vIcc: Downloading webpage
[youtube] gYO1uk7vIcc: Downloading video info webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: D:\cloudhiback\main\hibackcloud\data\25\video.mkv.f137
[download] 100% of 85.29MiB in 02:14
[download] Destination: D:\cloudhiback\main\hibackcloud\data\25\video.mkv.f251
[download] 100% of 3.16MiB in 00:03
[ffmpeg] Merging formats into "D:\cloudhiback\main\hibackcloud\data\25\video.mkv.mkv"
Deleting original file D:\cloudhiback\main\hibackcloud\data\25\video.mkv.f137 (pass -k to keep)
Deleting original file D:\cloudhiback\main\hibackcloud\data\25\video.mkv.f251 (pass -k to keep)

Description

def downloadvideo(vpath, proxy='',id=-1):
    ydl_opts = {
        'proxy': proxy,
        'outtmpl':getdatapath('/'+str(id)+'/video.mkv'),
        'format':'bestvideo[height<=?1080,ext=mp4]+bestaudio/best',
        'ffmpeg_location':getffmpegpath(),
    }
    # print ('test.')
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:

        ydl.download([vpath])

Problem:
1.when my code is 'outtmpl':getdatapath('/'+str(id)+'/video.mp4'), ,ffmpeg merge will output video.mkv
2.I changed .mp4 to .mkv ,still cause a problem,it will output video.mkv.mkv

I hope it does not check the file suffix and writes the file name directly.

The file name change is not convenient for me to write code to handle these videos.

Hope you can fix it,thank you very much.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 30, 2019

WARNING: Requested formats are incompatible for merge and will be merged into mkv.

@dstftw dstftw closed this Nov 30, 2019
@821938089
Copy link
Author

@821938089 821938089 commented Nov 30, 2019

But I can't know if this video needs to be merged, if not then what file name will it output?
video.mp4?
video.mkv?
video.mkv.mkv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.