GithubHelp home page GithubHelp logo

Comments (10)

elpatron68 avatar elpatron68 commented on May 26, 2024 1

Or something like this?

!findradio <station name>

Output:
<Station_Name> - <Station_ID>

!radio <Station_ID>

from botamusique.

elpatron68 avatar elpatron68 commented on May 26, 2024 1

As @andreztz seems not to solve the requirements problem with pyradios, I had a short look into the project´s code. It should be no problem to include radios.py from it into Botamusique. A small function like

from radios import RadioBrowser

rb = RadioBrowser()

def getstations_byname(query):
    results = rb.stations_byname(query)
    stations = []
    for st in results:
        try:
            url = rb.playable_station(st['id'])['url']
            station = {'stationname': st['name'], 'url': url}
            stations.append(station)
        except:
            pass
    return stations


if __name__ == "__main__":
    r = getstations_byname('r.sh')
    pass

would then return an array of stations and playable urls.

My python skills are quite poor, so this could shurely be done in a better way. Just an example.

from botamusique.

azlux avatar azlux commented on May 26, 2024

Thank for the report.
I don't have time right now, but I will take a look asap.

Az

from botamusique.

elpatron68 avatar elpatron68 commented on May 26, 2024

I just found a Python library for radio-browser which could make things easier: https://pypi.org/project/pyradios/

from botamusique.

azlux avatar azlux commented on May 26, 2024

How to you want to select a radio ? with the name ? the id ?

from botamusique.

elpatron68 avatar elpatron68 commented on May 26, 2024

If I had a free wish:

Input:
!listradio <station name>

Output:

1) <Match 1>
2) <Match 2>
...

Input:
!radio 1

Or something similar...

from botamusique.

azlux avatar azlux commented on May 26, 2024

I need to test something similar, botamusique don't have interaction process.

from botamusique.

azlux avatar azlux commented on May 26, 2024

I'm currently waiting for andreztz/pyradios#1 to work on it.

from botamusique.

elpatron68 avatar elpatron68 commented on May 26, 2024

Finally found some time to add it. Hope, it´s okay, see pr #52

from botamusique.

azlux avatar azlux commented on May 26, 2024

Thanks a lot.
I'm reading the commit,
Let's close the ticket and continue on the PR.

from botamusique.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.