Skip to content

Commit

Permalink
👷 CI: Bumped codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiTronix committed Dec 29, 2020
1 parent c2e82a0 commit f963eea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
35 changes: 16 additions & 19 deletions vidgear/gears/camgear.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,24 @@ def __init__(
# set parameters
for key, value in stream_params:
session.set_option(key, value)
# select valid stream resolutions
if streams:
# check whether stream-resolution was specified and available
if not stream_resolution in streams.keys():
# if unavailable
logger.warning(
"Specified stream-resolution `{}` is not available. Reverting to `best`!".format(
stream_resolution
)
)
# revert to best
stream_resolution = "best"
# extract url
source = streams[stream_resolution].url
else:
# raise error if something is wrong with URL.
raise RuntimeError(
"[CamGear:ERROR] :: Invalid `{}` URL cannot be processed!".format(
source
# select streams are available
assert (
streams
), "[CamGear:ERROR] :: Invalid `{}` URL cannot be processed!".format(
source
)
# check whether stream-resolution was specified and available
if not stream_resolution in streams.keys():
# if unavailable
logger.warning(
"Specified stream-resolution `{}` is not available. Reverting to `best`!".format(
stream_resolution
)
)
# revert to best
stream_resolution = "best"
# extract url
source = streams[stream_resolution].url
except Exception as e:
# raise error if something went wrong
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion vidgear/tests/videocapture_tests/test_camgear.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_threaded_queue_mode(source, options):
[
("https://youtu.be/uCy5OuSQnyA", "best", "invalid"),
("https://youtu.be/NMre6IAAAiU", "invalid", {"nocheckcertificate": True}),
("https://www.dailymotion.com/video/x7xsoud", "720p", {"hls-live-edge": 3.0}),
("https://www.dailymotion.com/video/x7xsoud", "invalid", {"hls-live-edge": 3.0}),
("im_not_a_url", "", {}),
],
)
Expand Down

0 comments on commit f963eea

Please sign in to comment.