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

Add Python function for testing YTDL url support #88

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

Conversation

rubdos
Copy link

@rubdos rubdos commented Oct 12, 2021

untested, wip

@accumulator
Copy link
Owner

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)

@rubdos
Copy link
Author

rubdos commented Oct 12, 2021

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 rubdos force-pushed the youtube-dl-query-url-support branch from b4d617e to 9878cf3 Compare November 4, 2021 07:38
@rubdos
Copy link
Author

rubdos commented Nov 4, 2021

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.

@accumulator
Copy link
Owner

accumulator commented Nov 4, 2021

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

// selection by format_id for youtube, vimeo, streamable
// mp4-mobile: 360p (streamable.com)
// 18: 360p,mp4,acodec mp4a.40.2,vcodec avc1.42001E (youtube)
// 22: 720p,mp4,acodec mp4a.40.2,vcodec avc1.64001F (youtube)
// http-360p: 360p (vimeo)
// http-720p, 720p (vimeo)

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.

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.

None yet

2 participants