A collection of BASH scripts that interact with the iFunny servers' API, allowing for automation of certain tasks.
During my cybersecurity studies, I had forgotten to turn off some tools when I went on break, and ended up logging the HTTP/S traffic of the iFunny app. After a few hours of studying the traffic and messing around with the various endpoints of the iFunny servers, I managed to churn out some scripts that can be proven useful for automating painfully repetitive tasks.
Ethically speaking, I'll only release non-malicious scripts, like auto smiling someone's entire profile, auto self-deleting all the memes you posted, etc. Potentially malicious scripts, like comment scripting, will never be made as we've all dealt with certain comment bots over the years. I won't be responsible for whatever blight hits iFunny next.
Before using what I have offered here, at the very least, read up on how to interact with the Linux Command Line Interface. It will be assumed that you have basic understanding of CLI usage. Be aware that these scripts are built for Linux based operating systems, ie. Debian-based distros and Android. I have no plans on porting to Windows/Mac, or creating an app.
-
Do NOT use any scripts obtained outside of this repository.
-
This is THE only official source for my toolkit.
-
All OTHER sources are to be assumed MALICIOUS.
-
Use common sense, and use RESPONSIBLY.
-
I am NOT liable for the actions of others.
-
I am NOT affiliated with any iFunny accounts.
Since Android is based on Linux, these scripts can be executed on your mobile device without needing a Linux PC. The following steps will guide you through how to set things up.
-
"Termux is an Android terminal application and Linux environment."
-
You will need to start with grabbing the latest APK of Termux from their official repo, and installing it. The Play Store has Termux on it, but it is a very outdated version. My scripts are tested with the APK from their official repo.
- Pick the "universal.apk" version from the "Assets" section at https://github.com/termux/termux-app/releases/latest and install it.
-
First, you will need to make sure everything is up to date, run:
pkg update && pkg upgrade -y && pkg clean
-
Next, you will need to allow Termux access to your local storage. This is needed for Termux to download straight to your user Downloads folder. Run the following command and allow the storage access permission when it pops up:
termux-setup-storage
-
Finally, you need to install some tool dependencies the scripts need in order to function:
pkg install -y git jq imagemagick exiftool aria2 file
- git - to download this repo
- jq - to parse JSON objects
- imagemagick - to crop off the meme's watermark
- exiftool - to embed the creation date metadata for sorting memes by date
- aria2 - to perform parallel meme downloads
- file - to determine meme file type
-
Clone the latest release of this repo:
git clone -b $(curl -s https://api.github.com/repos/Katyatu/iFunnyScriptingToolkit/tags | jq -r '.[0].name') https://github.com/Katyatu/iFunnyScriptingToolkit.git -
Move into the toolkit:
cd iFunnyScriptingToolkit/tools -
Make all scripts executable:
chmod -R u+x ./
-
Add the toolkit to your $PATH and apply changes:
echo 'export PATH=${PATH}:'"$(pwd)" >> ~/.bashrc; source ~/.bashrc
- Note: By adding the absolute path of
iFunnyScriptingToolkit/toolsto your $PATH, you no longer need tocd iFunnyScriptingToolkit/toolsevery time you start Termux. You will be able to call the scripts from where ever your current directory is at, such as~/. Just start by typing in the script name and hitTAB(the⇌button underESC), it should autofill the rest of script name. If it doesn't autofill, check your spelling (case-sensitive) or double tap⇌to list possible matches.
- Note: By adding the absolute path of
-
In order for the scripts' API requests to go through, it needs authentication.
-
When you log into your account on the iFunny app, the iFunny servers return a "Bearer Token" that serves as identification.
-
Every single interaction you perform in the app, ie. smiling, subbing, etc., all include that token in the API request, so the servers know which account to perform the requested action with.
-
I made a script that mimics the action of logging in via iFunny app, outside of the app, capturing the returned Bearer Token for the other scripts to use as authentication.
-
Be aware, you will need to provide your iFunny account email and password to get this token.
-
Start by viewing the "Get-Your-iF-Bearer-Token.sh" script code with your own eyes:
cat ./Get-Your-iF-Bearer-Token.sh
- Bonus points if you feed the code into an "AI" like Grok and ask it to look for anything malicious.
-
If you are satisfied, execute the script like so:
Get-Your-iF-Bearer-Token.sh 'ifunny@email.com' 'ifunnyPass'
- Please note the SINGLE quotes surrounding the arguments. Do NOT use DOUBLE quotes as the command line will interpret some symbols as console specific actions.
-
Read the script output, I tried to make it as verbose and catch as many errors as possible. You will know if it failed or succeeded.
- If it fails, read the output and act accordingly.
- If it succeeds, a
.bearertokenfile will be created containing your token.
-
If you made it this point, you are ready to start using the toolkit!
Skip this section if you're using Android.
This section will assume you are familiar with a Debian-based environment, so instructions will be brief and to the point. Read the Android section if you want extra step details.
sudo apt install git jq imagemagick exiftool aria2 filegit clone -b $(curl -s https://api.github.com/repos/Katyatu/iFunnyScriptingToolkit/tags | jq -r '.[0].name') https://github.com/Katyatu/iFunnyScriptingToolkit.gitcd iFunnyScriptingToolkit/tools
chmod -R u+x ./
echo 'export PATH=${PATH}:'"$(pwd)" >> ~/.bashrc; source ~/.bashrcGet-Your-iF-Bearer-Token.sh 'ifunny@email.com' 'ifunnyPass'Make sure you are in the "tools" folder of "iFunnyScriptingToolkit", and that you surround your arguments with SINGLE quotes.
Get-Your-iF-Bearer-Token.sh 'arg1' 'arg2'- Gets your iFunny account's Bearer Token. Required for the below scripts to be authenticated with the API.
- arg1: Your iFunny account email
- arg2: Your iFunny account password
Download-All-Memes-Of-User.sh 'arg1'- Downloads every meme the selected user has posted.
- arg1: Name of user
- Note: The download path depends on the running device:
- Android:
Files → Downloads → iFST- Use the app "Cx File Explorer" if your default Files app shows the folder empty.
- Linux:
iFunnyScriptingToolkit/tools
- Android:
Get-Direct-Meme-Link.sh 'arg1'- Gets the direct media link for the selected meme, allowing for direct download and embedding.
- arg1: Meme URL from 'Copy link' in app
Smile-All-Memes-Of-User.sh 'arg1'- Smiles every meme the selected user has posted.
- arg1: Name of user
Desmile-All-Memes-Of-User.sh 'arg1'- Desmiles every meme the selected user has posted (not to be confused with unsmile).
- arg1: Name of user
Unsmile-All-Memes-Of-User.sh 'arg1'- Unsmiles every meme the selected user has posted.
- arg1: Name of user
Deunsmile-All-Memes-Of-User.sh 'arg1'- Deunsmiles every meme the selected user has posted.
- arg1: Name of user
Clear-My-Smiled-Memes.sh- Desmiles every meme in the smiles category of your profile.
Clear-My-Subscriptions.sh- Unsubscribes you from each account found in your subscriptions list.
- Starts from the list's top and sequentially works its way down to the bottom.
CTRL+Cto stop it whenever, otherwise it will unsubscribe you from everything.
Delete-All-Of-Your-Unpinned-Memes.sh- Deletes every unpinned meme you have ever posted.
- Irreversible, requires explicit permission, impossible to accidentally execute.
Smile-All-Memes-Of-User.sh 'cirke'Unsmile-All-Memes-Of-User.sh 'ColDirtybastard'-
Treat your Bearer Token like an API key. Anyone that has it has control of your iFunny account. Change your password if you believe your token is compromised, this will invalidate all existing tokens.
-
The iFunny servers have rate limits. Only execute one script at a time. Executing more than one script will lead to repeated human verification tests, thus wasting a lot of time. Go slow, be patient.
-
The content delivery network iFunny uses seems to either be rate limitless, or has a high tolerance. You might be able to get away with running multiple instances of the downloader script, but don't overdo it.
-
Check back here from time to time for updates and additional scripts.
This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, and is intended for personal, non-commercial use only.
You Are Allowed To:
- Copy and redistribute unmodified code
You Are NOT Allowed To:
- Redistribute modified code
- Use un/modified code for commercial use