-
Notifications
You must be signed in to change notification settings - Fork 0
/
streamer.py
83 lines (65 loc) · 1.71 KB
/
streamer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"""
RK Streamer
A command-line music player that allows you to play/stream songs, albums, playlists.
Author: Ray A.
Email: ray@raysecure.ml
(c) 2023 Ray A. All rights reserved.
License:
This project is licensed under the terms of the MIT License.
See the LICENSE file for more information.
"""
from rkstreamer.state import State, StateMachine
from rkstreamer.services.player import PyVLCPlayer
from rkstreamer.services.network import PyRequests
from rkstreamer.models import (
JioSaavnSongModel,
JioSaavnAlbumModel,
JioSaavnPlaylistModel
)
from rkstreamer.views import (
JioSaavnSongView,
JioSaavnAlbumView,
JioSaavnPlaylistView
)
from rkstreamer.controllers import (
JioSaavnSongController,
JioSaavnAlbumController,
JioSaavnPlaylistController
)
# proxy = {'https': 'http://127.0.0.1:8888'}
pyrequests = PyRequests(proxy=None)
song_controller = JioSaavnSongController(
model=JioSaavnSongModel(pyrequests),
view=JioSaavnSongView(player=PyVLCPlayer())
)
album_controller = JioSaavnAlbumController(
model=JioSaavnAlbumModel(pyrequests),
view=JioSaavnAlbumView(player=PyVLCPlayer())
)
plist_controller = JioSaavnPlaylistController(
model=JioSaavnPlaylistModel(pyrequests),
view=JioSaavnPlaylistView(player=PyVLCPlayer())
)
song = State(
"song",
"Enter the song name: ",
song_controller
)
album = State(
"album",
"Enter the album name: ",
album_controller
)
playlist = State(
"plist",
"Enter the playlist name: ",
plist_controller
)
print(r"""
*** RK Streamer ***
@Powered by Jio Saavn
""")
streamer = StateMachine()
streamer.add_state({'song': song, 'album': album, 'plist': playlist})
streamer.set_start_state('song')
streamer.trigger()