banner
Fr4nk

Hello! Fr4nk

瞎折腾第一名🥇

Follow batch subscription to your own Bilibili follows

It was not easy to get the Follow invitation code and set up my own information flow with the self-built RSSHUB. I am also a frequent user of RSS, but the only drawback is that most RSS readers have very low support for embedded videos, making them basically unusable.

In this regard, Follow does quite well, but when I subscribed to the 投稿 videos of the UP I follow through the RSSHUB self-built service, there was a bug where the embedded videos could not be played. However, if I directly subscribe to the UP's channel, the embedded videos play without any issues. Therefore, I wrote a Python script that, combined with the [Bilibili] Follow Manager Tampermonkey script, allows me to batch subscribe to my followed users.

  1. Use the [Bilibili] Follow Manager to export the UID of the UPs I follow and save it in TXT format.

step.1

image

step.2

image

step.3

image

  1. Use the script to generate an OPML format file.
import xml.etree.ElementTree as ET

def create_opml(input_file, output_file):
    # Read the input file
    with open(input_file, 'r') as f:
        ids = f.read().strip().split(',')
    
    # Create OPML structure
    opml = ET.Element('opml', version='1.0')
    head = ET.SubElement(opml, 'head')
    ET.SubElement(head, 'title').text = 'Bilibili User Video RSS Subscription'
    body = ET.SubElement(opml, 'body')
    
    # Create outline elements
    for id in ids:
        # Replace with your own server address
        url = f'https://your.server.url/bilibili/user/video/{id.strip()}'
        outline = ET.SubElement(body, 'outline', 
                                text=f'Bilibili User {id}',
                                title=f'Bilibili User {id}',
                                type='rss',
                                xmlUrl=url,
                                htmlUrl=url)
    
    # Generate XML tree
    tree = ET.ElementTree(opml)
    
    # Write to file
    tree.write(output_file, encoding='utf-8', xml_declaration=True)

# Use the function
create_opml('input.txt', 'output.opml')
  1. Import Follow

image

I can only say it's very nice, everyone come and use Follow! I hope a mobile version comes out soon!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.