Skip to content

Commit

Permalink
Remove moviepy [#1] Done
Browse files Browse the repository at this point in the history
  • Loading branch information
adw0rd committed Dec 23, 2020
1 parent bbb76c8 commit ba62b5e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The current types are in [types.py](/instagrapi/types.py):
| UserShort | Short public user data (used in Usertag, Comment, Media, Direct) |
| Usertag | Tag user in Media (coordinates + UserShort) |
| Location | GEO location (GEO coordinates, name, address) |
| Hashtag | Hashtag object (id, name, picture)
| Hashtag | Hashtag object (id, name, picture) |
| Collection | Collection of medias (name, picture and list of medias) |
| Comment | Comments to Media |
| StoryMention | Mention users in Story (user, coordinates and dimensions) |
Expand Down
7 changes: 6 additions & 1 deletion instagrapi/mixins/igtv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import List
from uuid import uuid4
from PIL import Image
import moviepy.editor as mp

from instagrapi import config
from instagrapi.extractors import extract_media_v1
Expand Down Expand Up @@ -188,6 +187,12 @@ def igtv_configure(
def analyze_video(path: Path, thumbnail: Path = None) -> tuple:
"""Analyze and crop thumbnail if need
"""

try:
import moviepy.editor as mp
except ImportError:
raise Exception('Please install moviepy>=1.0.3 and retry')

print(f'Analizing IGTV file "{path}"')
video = mp.VideoFileClip(str(path))
width, height = video.size
Expand Down
7 changes: 6 additions & 1 deletion instagrapi/mixins/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from pathlib import Path
from typing import List
from uuid import uuid4
import moviepy.editor as mp
from urllib.parse import urlparse

from instagrapi import config
Expand Down Expand Up @@ -375,6 +374,12 @@ def video_configure_to_story(
def analyze_video(path: Path, thumbnail: Path = None) -> tuple:
"""Analyze video file
"""

try:
import moviepy.editor as mp
except ImportError:
raise Exception('Please install moviepy>=1.0.3 and retry')

print(f'Analizing video file "{path}"')
video = mp.VideoFileClip(str(path))
width, height = video.size
Expand Down
7 changes: 6 additions & 1 deletion instagrapi/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
from pathlib import Path
from typing import List

from moviepy.editor import TextClip, CompositeVideoClip, VideoFileClip, ImageClip
try:
from moviepy.editor import (
TextClip, CompositeVideoClip, VideoFileClip, ImageClip
)
except ImportError:
raise Exception('Please install moviepy==1.0.3 and retry')

from .types import StoryBuild, StoryMention

Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='instagrapi',
version='1.3.2',
version='1.3.3',
author='Mikhail Andreev',
author_email='[email protected]',
license='MIT',
Expand All @@ -28,7 +28,6 @@
'pytz==2020.1',
'requests==2.24.0',
'PySocks==1.7.1',
'moviepy==1.0.3',
'Pillow==7.2.0',
'pydantic==1.7.2'
],
Expand Down

0 comments on commit ba62b5e

Please sign in to comment.