Exemplo n.º 1
0
def send_login_url(to):
    """
    The user attempted to like a
    song from the queue but has not yet
    logged into SoundCloud, send them
    a register url.
    """
    sc_connector = SoundCloud()
    data = {SC_Reg_Key: sc_connector.request_register_url(to)}
    payload = json.dumps({D_Key: data, 'to': to})
    send_data_fcm(payload)
Exemplo n.º 2
0
    def create_hash(self):
        sc_connector = SoundCloud()

        self.track = sc_connector.get_track(self.sound_url)
        stream_url = sc_connector.get_stream_url(self.track)

        self.info_package = {S_Key: self.sound_url,
                             STR_Key: stream_url.location,
                             ALB_Key: self.track.artwork_url,
                             T_Key: self.track.title
                             }

        self.sound_package = {SP_Key: self.info_package,
                              A_Key: self.track.user
                              }

        self.save_sound_package()

        # return the data requested from sound cloud
        return self.sound_package