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

outtmpl syntax error #22106

Closed
DexsLaboratory opened this issue Aug 15, 2019 · 1 comment
Closed

outtmpl syntax error #22106

DexsLaboratory opened this issue Aug 15, 2019 · 1 comment
Labels

Comments

@DexsLaboratory
Copy link

@DexsLaboratory DexsLaboratory commented Aug 15, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

WRITE QUESTION HERE
Hey yall, im trying to run youtube-dl in a python shell so it can read a file with youtube links in it and extract the audio, im using the following script below:

from __future__ import unicode_literal
import youtube_dl
import os
from sys import argv

download_options = {
        'format': 'bestaudio/best'
        'outtmpl': '/tmp/foo_%(title)s-%(id)s.%(ext)s' 
        # Syntax Error Is The Outtmpl Line Above On The Colon
        'nocheckcertificate': True
        'postprocessors': [{
                'key': 'FFmpegExtractAudio'
                'preferredcodec': 'mp3'
                'prefferedquality': '192'
        }].
}

# Song Directory
if not os.path.exists('Songs')
        os.mkdir('Songs')
else:
        os.chidr('Songs')

# Download Songs
with youtube_dl.YoutubeDL(download_options) as dl:
        with open('../' + argv[1]. 'r') as f:
                for song_url in f:
                        dl.download([song_url])

The problem with the code is that the colon on the outtmpl line (knowing which file to extract links from) is getting a syntax error and i cant figure out why, im running this on python 3.7.4

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 15, 2019

Nothing to do with output template. Bother to read some basic doc on python dict's syntax.

@dstftw dstftw closed this Aug 15, 2019
@dstftw dstftw added the invalid label Aug 15, 2019
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.