banner
Fr4nk

Hello! Fr4nk

瞎折腾第一名🥇

Follow批量訂閱自己的B站關注

好不容易整到 Follow 的邀请码,配合自建的 RSSHUB 搭建屬於自己的信息流。我也是 RSS 的高頻使用者了,但是唯一的缺陷是大多數的 RSS 閱讀器對內置視頻的支持度相當的低,基本屬於不可用。

在這方面 Follow 做的相當好,但是當我通過 RSSHUB 自建服務訂閱我關注的 UP 的投稿視頻時,出現了內嵌視頻無法播放的 BUG,而如果直接訂閱 UP 的頻道則內嵌視頻播放沒有問題,因此我寫了一個 py 腳本,結合[Bilibili] 关注管理器這個油猴腳本,實現批量訂閱自己的關注。

  1. 使用[Bilibili] 关注管理器導出自己關注的 UP 的 UID,並保存為 TXT 格式

step.1

image

step.2

image

step.3

image

  1. 使用腳本生成 OPML 格式的文件
import xml.etree.ElementTree as ET

def create_opml(input_file, output_file):
    # 讀取輸入文件
    with open(input_file, 'r') as f:
        ids = f.read().strip().split(',')
    
    # 創建OPML結構
    opml = ET.Element('opml', version='1.0')
    head = ET.SubElement(opml, 'head')
    ET.SubElement(head, 'title').text = 'Bilibili用戶視頻RSS訂閱'
    body = ET.SubElement(opml, 'body')
    
    # 創建outline元素
    for id in ids:
        # 替換成自己的伺服器地址
        url = f'https://your.server.url/bilibili/user/video/{id.strip()}'
        outline = ET.SubElement(body, 'outline', 
                                text=f'Bilibili用戶 {id}',
                                title=f'Bilibili用戶 {id}',
                                type='rss',
                                xmlUrl=url,
                                htmlUrl=url)
    
    # 生成XML樹
    tree = ET.ElementTree(opml)
    
    # 寫入文件
    tree.write(output_file, encoding='utf-8', xml_declaration=True)

# 使用函數
create_opml('input.txt', 'output.opml')
  1. 導入 Follow

image

只能說很香,大家都來用 Follow 吧!希望速速出移動端!

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。