예제 #1
0
파일: run.py 프로젝트: NovAlpBra/Rec-adio
def main_radiko():
    Radiko = radiko.radiko()
    Radiko.change_keywords(keywords)
    radiko_data = Radiko.search()
    while (True):
        now = DT.datetime.now()
        #print(radiko_data)
        if (bool(radiko_data)):
            for data in radiko_data:
                tmp_time = data["DT_ft"] - now
                if (tmp_time < T_ZERO):
                    radiko_data.remove(data)
                elif (tmp_time < T_BASELINE):
                    AuthToken = Radiko.authorization()
                    p = Process(target=radiko.rec,
                                args=([
                                    data,
                                    tmp_time.total_seconds(), AuthToken,
                                    SAVEROOT, dbx
                                ], ))
                    p.start()
                    radiko_data.remove(data)
        if (now.hour == 6 and now.minute <= 5
                and Radiko.reload_date != DT.date.today()):
            Radiko.reload_program()
            radiko_data = Radiko.search()
        time.sleep(60)
예제 #2
0
def main_radiko():
    Radiko = radiko.radiko()
    AuthToken = Radiko.authorization()
    program = {
        "title": "test_rec",
        "ft": "20190829181110",
        "dur": 60,
        "station": "QRR"
    }
    p = Process(target=radiko.rec, args=([program, 0, AuthToken, SAVEROOT, dbx],))
    p.start()
    t = 0
    while(True):
        print(t)
        t += 10
        time.sleep(10)