openzim / youtube

Create a ZIM file from a Youtube channel/username/playlist
GNU General Public License v3.0
43 stars 26 forks source link

checking youtubeID in input #135

Closed mahakporwal02 closed 3 years ago

mahakporwal02 commented 3 years ago

Fixed #109 Checking input of youtubeID by user and finishing it early if error occurs.

mahakporwal02 commented 3 years ago

@rgaudin I think API request would be more consistent method for implementing this, sorry for wasting your time. I'll try to implement it accordingly

rgaudin commented 3 years ago

@rgaudin I think API request would be more consistent method for implementing this, sorry for wasting your time. I'll try to implement it accordingly

I think you're getting off track. We already fail on incorrect IDs specifically when we try to retrieve info from the API. What you are now suggesting won't help much.

What the issue is about is failing very early in case it's an obvious type-ID combination error.

rgaudin commented 3 years ago

OK Thanks ; as you've seen it's become very minimal. A new quick check we can add is looking if there are commas , in the ID. There should not be any for channel nor user mode. Commas are only for passing a list of playlists in playlist mode.

If there are commas, it might be good to remove spaces from the ID as a common mistake is to separate playlists IDs with , instead of ,. Also, spaces are not allowed in IDs anyway.

mahakporwal02 commented 3 years ago

@rgaudin Pls have a look, I have updated the PR

rgaudin commented 3 years ago

you're right

mahakporwal02 commented 3 years ago

you're right

Thanks