Beispiel #1
0
def rename_cookie_file():
    # The file "COOKIE_xxxxxx..." will be renamed to "COOKIES"
    list_files = list_dir(G.DATA_PATH)[1]
    for filename in list_files:
        if 'COOKIE_' in filename:
            copy_file(join_folders_paths(G.DATA_PATH, filename),
                      join_folders_paths(G.DATA_PATH, 'COOKIES'))
            xbmc.sleep(80)
            delete_file(filename)
Beispiel #2
0
def _migrate_strm_files(folder_path):
    # Change path in STRM files
    for filename in list_dir(folder_path)[1]:
        if not filename.endswith('.strm'):
            continue
        file_path = join_folders_paths(folder_path, filename)
        file_content = load_file(file_path)
        if not file_content:
            LOG.warn(
                'Migrate error: "{}" skipped, STRM file empty or corrupted',
                file_path)
            continue
        if 'action=play_video' in file_content:
            LOG.warn('Migrate error: "{}" skipped, STRM file type of v0.13.x',
                     file_path)
            continue
        file_content = file_content.strip('\t\n\r').replace(
            '/play/', '/play_strm/')
        save_file(file_path, file_content.encode('utf-8'))