Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uri2addon for yt video parsing #1019

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielkucera
Copy link

As recommended in #1010 , use uri2addon for parsing yt links by the plugin
see comment #1010 (comment)

+ playUri.getLastPathSegment();
if (host.endsWith("youtube.com") || host.endsWith("youtu.be")) {
return "plugin://plugin.video.youtube/uri2addon/?uri="
+ playUri.toString();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to percent-encode it first?

(Sorry for the previous comment, clicked on the wrong place)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @peat-psuwit ,
I am using a patched version since I opened this PR and it works without any issues like this.
I also captured the communication and I don't see any issues there either:

03:39:00.924342 IP 192.168.1.104.47800 > 192.168.1.145.9090: Flags [P.], seq 60:221, ack 90, win 128, options [nop,nop,TS val 3627711265 ecr 166447552], length 161
E.../,@[email protected]......#.3...9..M....o......
.:{!	...{"jsonrpc":"2.0","method":"Player.Open","id":2,"params":{"item":{"file":"plugin://plugin.video.youtube/uri2addon/?uri=https://youtube.com/watch?v=qDWkpDKA3eQ"}}}
03:39:00.967090 ethertype IPv4, IP 192.168.1.145.9090 > 192.168.1.104.47800: Flags [P.], seq 90:128, ack 221, win 235, options [nop,nop,TS val 166447565 ecr 3627711265], length 38
E..Z.!@[email protected]#...9..M3..<...........
	....:{!{"id":2,"jsonrpc":"2.0","result":"OK"}

@MoojMidge, can you confirm the url encoding is strictly necessary?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MoojMidge, can you confirm the url encoding is strictly necessary?

For every type of url that the plugin supports? No.
For any type of url that the plugin supports? Yes.

As a simply example try https://youtube.com/watch?v=qDWkpDKA3eQ&t=1m6s and see the difference that url encoding makes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a new version, the resulting request looks like this:

11:59:08.012913 IP realme-9.byt.danman.eu.39418 > 192.168.1.145.9090: Flags [P.], seq 138:312, ack 77, win 128, options [nop,nop,TS val 3635122324 ecr 173949325], length 174
E...IY@[email protected]......#.......o.....-......
....
^A.{"jsonrpc":"2.0","method":"Player.Open","id":29,"params":{"item":{"file":"plugin://plugin.video.youtube/uri2addon/?uri=https%3A%2F%2Fyoutube.com%2Fwatch%3Fv%3DCExTREBHktI"}}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants