YouTube-operational-API
YouTube-operational-API copied to clipboard
Could replace `\/` in URLs to `/`?
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.
I appreciate the idea of simplifying by using / instead of \/ but as YouTube works with \/ sometimes, we will keep their usage of it.
It's a bit hypocritical to use urldecode to replace %3D to = and not replace \/ with / (or maybe we shouldn't use urldecode).
Could also consider proposing a more user-friendly encoding charset.
Related to #129.