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

AttributeError: 'function' object has no attribute 'startswith' #7770

Closed
nadermx opened this issue Dec 5, 2015 · 3 comments
Closed

AttributeError: 'function' object has no attribute 'startswith' #7770

nadermx opened this issue Dec 5, 2015 · 3 comments

Comments

@nadermx
Copy link

@nadermx nadermx commented Dec 5, 2015

Not really sure how to fix this error.
Any help would be greatly appreciated?

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 568, in perform_job
    rv = job.perform()
  File "/usr/local/lib/python2.7/dist-packages/rq/job.py", line 495, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/home/www/yout/worker.py", line 91, in extract_audio
    extraction_result = start_extraction(url, audio_filename)
  File "/home/www/yout/worker.py", line 126, in start_extraction
    result = ydl.download([url])
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1669, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 674, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 720, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1339, in process_video_result
    self.process_info(new_info)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1417, in process_info
    info_dict['_filename'] = filename = self.prepare_filename(info_dict)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 578, in prepare_filename
    tmpl = compat_expanduser(outtmpl)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/compat.py", line 353, in compat_expanduser
    if not path.startswith('~'):
AttributeError: 'function' object has no attribute 'startswith'
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Dec 5, 2015

Post the full output of youtube-dl when run with --verbose option.

@nadermx
Copy link
Author

@nadermx nadermx commented Dec 5, 2015

I do have verbose, that is still the output it is giving.

here is my dict

    ydl_opts = {
    'format': 'bestaudio/best', # choice of quality
    'extractaudio' : True,      # only keep the audio
    'outtmpl': lambda: temp_filepath,  # name the location
    'noplaylist' : True,        # only download single song, not playlist
    'prefer-ffmpeg' : True,
    'verbose': True,
    'postprocessors': [{
            'key': 'FFmpegMetadata'
            },
            {
      'key': 'FFmpegExtractAudio',
      'preferredcodec': 'mp3',
      'preferredquality': '192',
      }],
    'logger': MyLogger(),
    'progress_hooks': [my_hook],
     }
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 5, 2015

 'outtmpl': lambda: temp_filepath,

It must be a string, not a function.

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
3 participants
You can’t perform that action at this time.