0
Parse a specific section of a YouTube URL
How would one parse out this section of a YouTube URL
Complete URL = https://www.youtube.com/watch?v=BbqlkY0ArfM
I want just this portion: v=BbqlkY0ArfM
This can then be used to watch a video from within Ninox.
7 replies
-
Try this. Mirko
let str := "BbqlkY0ArfM"; let videoString := "https://www.youtube.com/embed/" + str + ""; let content := "<iframe video= 'false' width=320px height=240px src=" + videoString + " frameborder='0' allow='accelerometer; encrypted-media; picture-in-picture' allowfullscreen></iframe>"; html(content)
-
My mistake. English ist not my nativ language. I think, in line 2 in this script ist the answer.
let url := URL; let str := item(split(url, "="), 1); let videoString := "https://www.youtube.com/embed/" + str + ""; let content := "<iframe video= 'false' width=320px height=240px src=" + videoString + " frameborder='0' allow='accelerometer; encrypted-media; picture-in-picture' allowfullscreen></iframe>"; html(content)
-
You can also use extractx:
extractx(urlfieldname, "\?(.*)", "i", "$1")
Love that chatgpt to point me in the right direction. Or this time it gave me the right code.
Content aside
- 1 yr agoLast active
- 7Replies
- 135Views
-
3
Following