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

Youtube Audio feature enhancement suggestions #744

Open
1 of 5 tasks
thepyguy opened this issue May 27, 2020 · 10 comments
Open
1 of 5 tasks

Youtube Audio feature enhancement suggestions #744

thepyguy opened this issue May 27, 2020 · 10 comments

Comments

@thepyguy
Copy link

thepyguy commented May 27, 2020

Feature enhancement affecting --youtube-audio-mix/stream

--youtube-audio-mix
--youtube-audio-mix-search
--youtube-audio-stream
--youtube-audio-stream-search

Description

"""
The goal of this feature-set is to improve the youtube listening experience within Tizonia and enable people to discover new artists.

Artists, songs, and link information has an official spot on audio mixes, but many mixes just list them in the description. Use youtube api to parse this information and handle it for mixes and streams.
"""

  • Show mix tracklist with timestamps --youtube-audio-mix*

  • Turn the timestamps into links

  • Highlight the currently playing track in the tracklist or for streams show currently playing track if available.

  • Turn "Youtube Id" into a hyperlink

  • Get higher bitrate audio from other audio containers besides webm.

  • Leave default behavior to get from webm since 160k webm is optimal, but implement a flag to get from other containers if it is a higher quality file.

@thepyguy
Copy link
Author

thepyguy commented May 27, 2020

Example of desired behavior

[Youtube] [Streaming] : 'psychill'.
Astral Dude : ૐ Chillout News ૐ Vol.55 (YT Version) / 05 - 2020 (Downtempo Psybient) (2 of 27)
Description : Monthly Mixes With Brand New Masterpieces Of PsyChill Psychedelic Chillout Ambient Psybient Downtempo mixed by As
Tracklisting:

  • 00:00 - Droplitz - Interlude
  • 03:54 - Dreamstate Logic - Code Of Existence
  • 12:11 - ambrosyd1 - Train To Elsewhere
  • 17:53 - Shantifax - Stardust
  • 22:54 - aldis7 - Artificial
  • 29:40 - Liquidroom - City Of Dreams
  • 36:44 - CatchAll - Solar Energy
  • 48:21 - Continuum - Flow State
  • 55:06 - Germind - Apocalypse
    - 62:28 - Celtotron - Siebenbrünnen
  • 72:32 - Dreamstate Logic - Forgotten Planet

Published : 2020-05-08 17:18:32Z
View Count : 11537
YouTube Id : DtHryyF5vi4
File Format : webm
Bitrate : 160k
Size : 84 MiB
Duration : 01h:24m:39s
Opus Stream : 2 Ch, 48000 Hz
2 Ch, 48 KHz, 16:s:l

@juanrubio
Copy link
Member

@thepyguy

Thanks for taking the time to post ideas, that's always useful.

Not that some of these ideas might not be feasible with Tizonia in its current form

Turn the timestamps into links
Turn "Youtube Id" into a hyperlink

I'm not sure this is doable. Some termnial emulators turn strings that start with http or https into clickable links, but that is not somthing that the application that outputs the string can do easily.

@thepyguy
Copy link
Author

thepyguy commented Jun 2, 2020

Maybe I'll fork and take a stab at a couple things when I have time since I'm using the youtube client frequently. Perhaps make another field for the youtube link or just turn the youtube id into the shorthand youtube link. i.e -- https://youtu.be/rc1xuDk9x5c maybe out of scope for what you are doing, and like you said maybe not wise for compatibility sakes. It'd be super nice to see the tracks in a mix though with the timestamps even if they dont highlight or anything.

I would think the API would return the tracks in the mix when they are added through the youtube default interface and not in the description. They could be gotten out of the description but probably a headache to parse them properly and consistently. If not it would be nice to one click and be able to see the full mix details on youtube itself.

@juanrubio
Copy link
Member

Maybe I'll fork and take a stab at a couple things

That would be great!

Replacing the YouTube id with a shortlink might actually be quite easy. All you would need is to experiment with the code in this file:
https://github.com/tizonia/tizonia-openmax-il/blob/master/clients/youtube/youtubeproxy/tizyoutubeproxy.py

You don't even need to build Tizonia from source (although that would ideal). E.g you could simply locate 'tizyoutubeproxy.py' on your Tizonia installation and make modifications there.

@thepyguy
Copy link
Author

thepyguy commented Jun 5, 2020

@juanrubio Thanks for making it easy but yeah I've already dived into the source code and have gone through that file I'll shoot you a PR for the link when I get a chance. Instead of building from source I could change modify that file and make a PR.

What would the advantage be for me to build from source?

Also, I am trying to find my Tizonia install and I can't seem to find where the python files are. Perhaps this is what you meant by build from source is optimal. Is it all built into /usr/include/tizonia?
$ whereis tizonia
tizonia: /usr/bin/tizonia /usr/include/tizonia /usr/share/man/man1/tizonia.1.gz

@juanrubio
Copy link
Member

What would the advantage be for me to build from source?

I guess it depends on whether you are looking to do some more profound changes. Tizonia is a hybrid C++/C/Python codebase. So depending on the changes that you are trying to make, re-compilation of C or C++ code could be needed.

You can start making changes to the Python code, that lives in this location on Ubuntu Focal:

  • /usr/lib/python3.8/site-packages/tizyoutubeproxy.py

or alternatively, you can look for this file on your distro using locate tizyoutubeproxy.py:

If after playing with this file, you realize you need/want to compile to modify other parts, you can look at building the code:
https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING_with_meson.md

These instructions are a bit generic and assume some prior experience of building C/C++ projects. Feel free to ping here if you need help.

@thepyguy
Copy link
Author

thepyguy commented Jun 8, 2020

Thanks for offering to help. My first very minor commit to make a shortlink from ytid. Functioning in my local tizonia install. I implemented the change in the fork and here is pull request on the development branch #748

PS: I don't know enough C or C++ to contribute to those areas unfortunately. I'm a web developer with JS, Python, HTML/CSS :( Sometimes I wish I got more into a compiled language at some point.

@juanrubio
Copy link
Member

pull request on the development branch #748

Thanks!. I've pulled and also merged to master.

JS, Python, HTML/CSS

There are lots of python 'proxies' in the 'clients' directory, in case you are interested. Also, the C / C++ under that same directory (clients) is fairly trivial; that C/C++ in there is just the bindings that wrap the Python code that talks to the streaming APIs so that it can be used by the OpenMAX il multimedia framework.

A very rough view of the architecure of Tizonia is this:

Tizonia player layer (written in C++, lots of Boost state machines, non-trivial)
             |
OpenMAX IL multimedia framework libs (implements a standard API by the Khronos group, written in C, libtizonia, libtizcore, etc)
             | 
OpenMAX IL multimedia plugin libs ('plugins' directory, written in C, media (http) streaming, demuxers, audio/video decoders, etc)
             | 
'Clients': bindings (written in C/C++, to adapt Python streaming APIs to C, in the 'clients' directory)
             | 
'Clients': Python 'proxies' (Python code that talks to the streaming services to obtain URLs to their tracks in the cloud)

@thepyguy
Copy link
Author

thepyguy commented Jun 13, 2020

Thanks for the breakdown.

Are you okay with me trying to parse track lists from mixes? If tracks are listed in the official track list location they should be easy enough to get hopefully from the API, and if not fallback to try and parse them out of the description?

Also an improvement to the description field could be instead of truncating characters to truncate by sentences or first paragraph?

@juanrubio
Copy link
Member

juanrubio commented Jun 13, 2020

By all means, please have a go at it!

I definitely did not put much thought or effort into polishing the presentation of information on the screen. This is a general issue that affects not only the YouTube proxy but the other proxies as well. So any steps to improve the current state of things would be very welcome!

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

No branches or pull requests

2 participants