Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
youtube-dl run from an Automator workflow does not repair malformed AAC bitstream automatically as it does when run from the terminal #15115
Comments
|
Post the complete youtube-dl log from automator. |
|
The full log was visible in the screenshot I uploaded, but here it is: 2017-12-30 01:04:49 +0000: Get Current Webpage from Safari completed Perhaps you could use this as well the results of running the script by adding -v to the shell script command. Here that is: |
|
That's not a complete log. There is no output written to stderr. |
|
Thank you for your reply. I see your point. Would anything be written to stderr if no error was detected. That is what I thought was happening here, that the error in the file was detected, and then corrected, when running youtube-dl in the Terminal, but not detected, perhaps not scanned for, when running youtube-dl as a shell script within Automator. If I am wrong about this, how would I obtain a more complete log? |
|
Change the Automator workflow to add (Also, paste the text of the log output here in a comment, don't use a screenshot.) |
|
Hi John, thank you for your input. You are right that I did not show the use of -v in the Automator workflow script even though I had implemented it before my earlier posting the output. The workflow now looks like this: Unfortunately,the output looks the same as as in my previous post except that this time the full download takes place since I deleted the earlier downloaded file. Here is the full output, still without the [debug] lines that follow the completion of the download when I run the script in terminal. ( |
|
Looks like you're only getting stdout and not stderr. Try:
|
|
Ah, thank you. Here is the output now. FYI, I do have FFMPEG installed, and it runs if I run youtube-dl from the terminal. ( |
|
This means
If the answer is, say,
|
|
Oh my God! That is fantastic. Thank you! The output is below, and more importantly the mp4 file is fixed and playable. Two questions, and I understand if you tell me merely that I need to study shell scripting more. If that is your recommendation, where might I start? First, why is there a need to use the export Path command when youtube-dl was already being called in that directory? Second, what does "2>&1" mean in this script? Thank you again. Here is the output. ( [download] 0.0% of ~5.70MiB at 101.26KiB/s ETA 39:27 [download] 99.9% of ~16.40MiB at 605.65KiB/s ETA 00:00 |
Unfortunately much of this is really the weird interaction between Automator and shell scripting. I don't have a good answer for you. It's certainly not a youtube-dl bug and this is definitely the wrong place.
The
It tells the shell to redirect the output of standard error (fd2) to standard output (fd1). This is, apparently, necessary because Automator captures the output of standard output but not standard error. |
|
John, Thank you again. My Automator service works now as desired. I have youtube-dl and ffmpeg installed in the same directory, and both in only one directory. I am using Homebrew to manage both. type -ap ffmpeg echo $PATH |
|
Doesn't make much sense, but apparently something is different in the shell spawned by Automator. So I suppose you should, for diagnostic purposes only, replace the Automator script with:
and see what it reports. Or we could just go home. |
|
I am game to try it, and here is the output within Automator of the script you suggested above: ( |
|
It should have reported two paths prior to the youtube-dl output that you pasted. Did you start copying at the very very top? Maybe add an |
|
I added the echo $PATH. Here is the whole script I am copying from Automator followed by the output. #!/bin/bash ( |
Before submitting an issue make sure you have:
What is the purpose of your issue?
[debug] System config: []
[debug] User config: [u'-o', u'~/Movies/%(title)s.%(ext)s', u'-f', u'mp4']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.smithsonianmag.com/videos/category/arts-culture/the-photography-of-eudora-welty/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.12.28
[debug] Python version 2.7.10 - Darwin-17.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.4.1, ffprobe 3.4.1
[debug] Proxy map: {}
[generic] the-photography-of-eudora-welty: Requesting header
WARNING: Falling back on generic information extractor.
[generic] the-photography-of-eudora-welty: Downloading webpage
[generic] the-photography-of-eudora-welty: Extracting information
[generic] the-photography-of-eudora-welty: Downloading m3u8 information
[debug] Invoking downloader on u'https://videos-f.jwpsrv.com/content/conversions/adUEQeXN/videos/KE0LykmE-30499008.mp4.m3u8?token=0_5a46e1df_0x7bca30aa4e4327c23b4fdc026d7e6ead038e35ae'
[download] /Users/rguibord/Movies/The Photography of Eudora Welty.mp4 has already been downloaded
[download] 100% of 15.19MiB
[debug] ffmpeg command line: ffprobe -show_streams 'file:/Users/rguibord/Movies/The Photography of Eudora Welty.mp4'
[ffmpeg] Fixing malformed AAC bitstream in "/Users/rguibord/Movies/The Photography of Eudora Welty.mp4"
[debug] ffmpeg command line: ffmpeg -y -i 'file:/Users/rguibord/Movies/The Photography of Eudora Welty.mp4' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:/Users/rguibord/Movies/The Photography of Eudora Welty.temp.mp4'
As can be seen from the -v output above, youtube-dl run from the Terminal automatically debugs the downloaded video with ffmpeg and repairs the downloaded video so that it can be played with Quicktime. But when I run youtube-dl through a workflow that I can invoke through Launchbar, it downloads the file but does not detect the "malformed AAC bitstream" nor repair it. This means that I then need to run a separate ffmpeg command on the file to repair it. My Automator workflow looks like this:
Screenshot 2017-12-29 15.05.16.pdf
Why doesn’t youtube-dl detect the malformed bitstream automatically when run this way? and can anyone help me modify the workflow so that it will. Thank you, -rg