Quickddit icon indicating copy to clipboard operation
Quickddit copied to clipboard

Add Python function for testing YTDL url support

Open rubdos opened this issue 4 years ago • 4 comments

untested, wip

rubdos avatar Oct 12 '21 07:10 rubdos

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)

accumulator avatar Oct 12 '21 11:10 accumulator

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.

rubdos avatar Oct 12 '21 12:10 rubdos

Got around to testing this a bit:

  1. It's indeed noticeably introducing lag during scrolling
  2. 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
)
  1. Seems like ytdl is now also going for imgur and i.reddit images, overruling the decision that they are images.

rubdos avatar Nov 04 '21 07:11 rubdos

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.

accumulator avatar Nov 04 '21 17:11 accumulator