this post was submitted on 11 Jul 2023
174 points (98.3% liked)

Reddit Was Fun

6494 readers
5 users here now

Memorial to "rif is fun for Reddit" Android app, aka "reddit is fun", shut down after June 30, 2023

founded 1 year ago
MODERATORS
 

One thing that annoyed me about moving to Lemmy was that I'd lose my subreddits and that looking for and joining communities on Lemmy would be tedious. So (logically) I spent 2 days writing a script, that gets a list of your subreddits from your reddit account and looks for communities with the same name on Lemmy. It also joins those communites. So all you have to do is download, enter your credentials and you're done.

https://github.com/induna-crewneck/Reddit-Lemmy-Migrator/

top 25 comments
sorted by: hot top controversial new old
[–] [email protected] 14 points 1 year ago (2 children)

How does this work when you have different communities on different instances?

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago)

It tries to subscribe to the one on lemmy.world as well as the most subscribed one on any instance according to lemmy.world.

[–] [email protected] 2 points 1 year ago (1 children)

You can access all instances from whichever server you are signing in from. Or am I misunderstanding your question?

[–] [email protected] 8 points 1 year ago (1 children)

They probably mean duplicate communities on different instances.

[–] [email protected] 0 points 1 year ago (2 children)

Why would that be an issue?

[–] [email protected] 12 points 1 year ago* (last edited 1 year ago) (1 children)

because it is not unequivocal mapping and he asks how you deal with the situation where you have 10 possible replacements. do you just sign to all of them?

[–] [email protected] 8 points 1 year ago (1 children)

Ah gotcha. It looks for the community on lemmy.world. It also searches for the community with the most subscribers. So for example you're looking for "videos" and that's on lemmy.world but also on lemmy.ml with more members, in this case you'd be subscribed to both.

[–] [email protected] 2 points 1 year ago (1 children)

Any way to make this compatible for kbin?

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Probably, I looked through the code briefly and it seems like its automating a headless browser to grab the subs from reddit, checking them on lemmy and subbing to them. You can likely replace it with kbin as needed. This is a quick scroll through though, I may be missing something here

[–] [email protected] 4 points 1 year ago (1 children)

Because some of these communities are more official than others. For example, I modded /r/simpleliving and made [email protected], but [email protected] also exists. It would be a bit annoying if users were directed to the less-active and less-official community over the one I made just because it happens to be on lemmy.world.

[–] [email protected] 1 points 1 year ago (1 children)

That's a fair point. In this case your lemmy.ml community would also be subscribed to, if it's any consolation.

[–] [email protected] 1 points 1 year ago (1 children)

How does this work if lemmy.world isn't your home instance? Will the same local community + most subscribed federated community rule apply?

[–] [email protected] 1 points 1 year ago

Your home instance doesn't change this script's behavior as is. Works regardless, though.

If you want, you can do a search and replace of "lemmy.world" with "lemmyserver" in the code.

[–] [email protected] 2 points 1 year ago

Update: Added a variation of the script that works with kbin

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Another great option is the browser app (shortcut bookmark, don’t go to the App Store) Voyager at [email protected].

It has a multireddit link import option that I really enjoyed. You basically go to your Reddit account, grab the multireddit link and import it on the app.

Voyager is excellent for those that loved Apollo. Has a similar feel.

[–] [email protected] 1 points 1 year ago (1 children)

Windows users: fwiw, i didn't want to go deal with Python and Chromium in Windows, so I tried to do this in WSL (v1) and gave up. Probably easily done in WSL v2, or with just using the Windows versions of everything.

[–] [email protected] 1 points 1 year ago (1 children)

Yeah, probably. I just try to make stuff cross-platform when it's not something that's probably only used on windows machines. Plus I'm trying to get better at python

[–] [email protected] 1 points 1 year ago

sure, just wanted to let anyone who might want to try to do the same thing i tried know, that it's probably not worth trying to do with WSL1 in Windows, wasn't like slamming it or making a feature request or anything, sorry if that wasn't clear :D

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

I don't have my Reddit accounts anymore but I did backup a list of subs. Can I use that list with your tool?

[–] [email protected] 2 points 1 year ago

Yes!

  • in the script comment out or delete lines 252-256
  • overwrite line 267 like this:

subs = ['subreddit1','subreddit2',etc]

  • run the script.

Should work. If you have questions or issues, let me know

[–] [email protected] 1 points 1 year ago (1 children)

First off, thank you for your work on this!

So I'm trying this out in WSL2 and I managed to get the script to run... but I have TOTP enabled on my reddit account. Any chance this could support MFA? I'm using the correct username and password I get "Incorrect username or password" so I'm sure it's the TOTP requirement not being met.

[–] [email protected] 2 points 1 year ago (1 children)

Yeah, totp isn't supported. Two workarounds, both of which include some work on your side:

  1. bypass reddit usage by the sxriot:
  • copy the link to your multireddit from old.reddit/subreddits. Now you have all your subreddits.
  • Paste them into a text editor
  • delete everything up until and including /r/, do search and replace replacing + with ',' (including the apostrophes).
  • At the beginning, add [' and at the end add ']. You should now have [] brackets and within all your subreddits in apostrophes and separated by a comma.
  • Copy all that and paste it in the script in line 267 so it reads :

subs = ['subreddit1','subreddit2',etc]

  • Comment out lines 252-256 by adding # to the beginning of the line.
  • Run the script and it should work.
  1. use totp/mfa:
  • enable change DEBUG=0 to DEBUG=1 at the top of the script.
  • comment out lines 90-93 and 255 by adding # to the beginning of the line
  • in line 94 change "time.sleep(3)" to "time.sleep(60)"
  • run the script. Now you should see a chrome window open and do stuff. Once you get to the reddit page, login how you normally would and wait. You have 60 seconds to do this and from there on the script should run normally.

Let me know if you have questions or issues

[–] [email protected] 1 points 1 year ago (1 children)

Thank you again for going to the trouble of making this workaround.

I went with Option 1 and I got an error "Error joining Lemmy communities." So I ran the script with the DEBUG option and I saw that after a few (can't remember how many) searches the site started responding with a rate limit error for the rest of the searches.

[–] [email protected] 1 points 1 year ago

That's odd. Haven't gotten a rate limit error from lemmy before.

[–] [email protected] 1 points 1 year ago

Does it need Chrome to be installed? I’m not an expert with python error messages:

The version of chrome cannot be detected. Trying with latest driver version Traceback (most recent call last): File "/Users/myname/Downloads/reddit-lemmy-migrator.py", line 33, in driver = webdriver.Chrome(options=chrome_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

load more comments
view more: next ›