YouTube-operational-API icon indicating copy to clipboard operation
YouTube-operational-API copied to clipboard

Could replace `\/` in URLs to `/`?

Open Benjamin-Loison opened this issue 2 years ago • 3 comments

It seems to, according to this Stack Overflow answer. The question is can we put a \ in a URL?

Note that JSON parsers will replace \/ to / anyway, as the following Python script shows:

import requests, json

url = 'https://yt.lemnoslife.com/channels?part=playlists&handle=Benjamin_Loison'
content = requests.get(url).text
data = json.loads(content)
thumbnailUrl = data['items'][0]['playlists']['savedPlaylists'][0]['thumbnails'][0]['url']
print(thumbnailUrl)

This issue would help when working with URL starting with view-source: to an endpoint of my API.

Benjamin-Loison avatar Jan 06 '23 23:01 Benjamin-Loison

I appreciate the idea of simplifying by using / instead of \/ but as YouTube works with \/ sometimes, we will keep their usage of it.

Benjamin-Loison avatar Jan 19 '23 23:01 Benjamin-Loison

It's a bit hypocritical to use urldecode to replace %3D to = and not replace \/ with / (or maybe we shouldn't use urldecode).

Benjamin-Loison avatar Jan 21 '23 14:01 Benjamin-Loison

Could also consider proposing a more user-friendly encoding charset.

Related to #129.

Benjamin-Loison avatar Jan 22 '23 03:01 Benjamin-Loison