Skip to content

Commit

Permalink
Remove requests as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed May 18, 2021
1 parent 2947e4a commit 3b9c944
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed `colorx` FX by `multiply_color` [\#1475](https://github.com/Zulko/moviepy/pull/1475)
- Renamed `speedx` FX by `multiply_speed` [\#1478](https://github.com/Zulko/moviepy/pull/1478)
- `make_loopable` transition must be used as FX [\#1477](https://github.com/Zulko/moviepy/pull/1477)
- `requests` package is no longer a dependency [\#1566](https://github.com/Zulko/moviepy/pull/1566)

### Deprecated <!-- for soon-to-be removed features -->
- `moviepy.video.fx.all` and `moviepy.audio.fx.all`. Use the fx method directly from the clip instance or import the fx function from `moviepy.video.fx` and `moviepy.audio.fx`. [\#1105](https://github.com/Zulko/moviepy/pull/1105)
Expand Down
10 changes: 4 additions & 6 deletions moviepy/video/io/downloader.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Utilities to get a file from the internet."""

import os

import requests
import shutil
import urllib.request

from moviepy.tools import subprocess_call

Expand All @@ -18,10 +18,8 @@ def download_webfile(url, filename, overwrite=False):
return

if "." in url:
r = requests.get(url, stream=True)
with open(filename, "wb") as fd:
for chunk in r.iter_content(chunk_size=128):
fd.write(chunk)
with urllib.request.urlopen(url) as req, open(filename, "wb") as f:
shutil.copyfileobj(req, f, 128)

else:
try:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def run_tests(self):
"imageio>=2.5,<3.0",
"imageio_ffmpeg>=0.2.0",
"numpy>=1.17.3,<=1.20",
"requests>=2.8.1,<3.0",
"proglog<=1.0.0",
]

Expand Down

0 comments on commit 3b9c944

Please sign in to comment.