Skip to content

Error when uploading video - "AttributeError: 'NoneType' object has no attribute 'extension'" #46

@LAMike310

Description

@LAMike310

I cloned the repo and tried to run the example "upload-a-video.py":

from instapy_cli import client
  
username = 'xxxxx'
password = 'xxxxx'
video = '../docs/video-sample-upload.mp4'
text = 'This will be the caption of your video.' + '\r\n' + 'You can also use hashtags! #hash #tag #now'

with client(username, password) as cli:
    cli.upload(video, text)

But I got an error in the console that said:

Reusing settings: ig.json
Traceback (most recent call last):
  File "upload-a-video.py", line 9, in <module>
    cli.upload(video, text)
  File "/Library/Python/2.7/site-packages/instapy_cli/cli.py", line 105, in upload
    media = Media(file)
  File "/Library/Python/2.7/site-packages/instapy_cli/media.py", line 29, in __init__
    self.check_type()
  File "/Library/Python/2.7/site-packages/instapy_cli/media.py", line 32, in check_type
    self.media_ext = filetype.guess(self.media_path).extension
AttributeError: 'NoneType' object has no attribute 'extension'

Any idea what I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions