here is a naive solution with praw, it assumes you have a text file containing the subreddits you wish to subscribe to and a custom application added to your reddit account:
import praw
reddit = praw.Reddit(
user_agent="mass sub",
# visit https://old.reddit.com/prefs/apps/ to add a new script
# choose http://localhost:8080 as a random and unused callback url
client_id="",
client_secret="",
username="",
password=""
)
# for each in list of subreddits call this
file1 = open('./some_txt_file_of_subreddits', 'r')
Lines = file1.readlines()
for line in Lines:
print("Line: {}".format(line.strip()))
reddit.subreddit(line.strip()).subscribe()
it is naive because there is probably a method to do this much more efficiently
if you need to generate a list of subreddits from an existing account you can use this bookmarklet
The bookmarklet script below should be run on
https://www.reddit.com/subreddits/mine/
javascript:$('body').replaceWith('<body>'+$('.subscription-box').find('li').find('a.title').map((_, d) => $(d).text()).get().join("<br>")+'</body>');javascript.void()
where the output can be saved to a text file
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…