anijackich / kinescope-dl

Command-line program to download videos from Kinescope.io
The Unlicense
125 stars 15 forks source link

Potential bug #6

Closed ic-it closed 1 year ago

ic-it commented 1 year ago

https://github.com/anijackich/kinescope-dl/blob/043da13cdb5b089cb68f03279e6070db25e5f117/kinescope-dl.py#L47

Alternative, more pythonic code:

is_video_id = not source.startswith("http")

But the link may be similar to this one: example.com

Solution As I noticed, the id's are in UUID format, presumably UUID-4. ```py from uuid import UUID ... try: UUID(source) is_video_id = True except ValueError: is_video_id = False ... ``` Well, or put this logic in the utilities. https://stackoverflow.com/a/33245493