Quickddit
Quickddit copied to clipboard
Add Python function for testing YTDL url support
untested, wip
The main reason I haven't hooked it up to YTDL yet is speed (it would query YTDL's python code for every post in the list)
The main reason I haven't hooked it up to YTDL yet is speed (it would query YTDL's python code for every post in the list)
Yeh, I already thought that might've been a problem. I'll test it out when I figure out how to get the API keys and secrets done. I'll probably try to come up with a faster way if it's indeed slow the way I did it now.
Got around to testing this a bit:
- It's indeed noticeably introducing lag during scrolling
- The Python module is not loaded when the first requests are fired for the function, throwing a few of these:
[D] unknown:0 - "PyOtherSide error: Traceback (most recent call last):\n\n File \"<string>\", line 1, in <module>\n\nNameError: name 'ytdl_wrapper' is not defined\n"
[D] onError:73 - python error: Function not found: 'ytdl_wrapper.isVideoUrlSupported' (Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'ytdl_wrapper' is not defined
)
- Seems like ytdl is now also going for imgur and i.reddit images, overruling the decision that they are images.
It might be useful though to lazily check a link when opening the comments page for a post. That would allow more videos to be played, just not directly from a subreddit view.
However, there's a second part to all this, which is the extraction of a suitable media url from the info datastructure returned from ytdl. See https://github.com/accumulator/Quickddit/blob/065c49d5212301669e676f2a5dfa110b265f6b21/sailfish/qml/VideoViewPage.qml#L222-L227 It is not uniform across video sites. There is an option in ytdl to pass video selection criteria, which might alleviate this issue, but I've never looked deeper into it.