Skip to content

This handy application is designed to make downloading videos and images from various social media platforms a breeze. Whether you're looking to save a memorable Instagram video, a high-resolution YouTube clip, a Pinterest image, or media from Twitter, this toolkit has got you covered.

License

Notifications You must be signed in to change notification settings

MSC72m/media_downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Social Media Toolkit

Overview

The Social Media Toolkit is an easy-to-use application that helps you download media content from social media platforms like Instagram, YouTube, Twitter, and Pinterest. It uses Python libraries like requests, BeautifulSoup, instaloader, and pytube, and has a simple GUI built with customtkinter.

Features

  • Download Videos from YouTube and Instagram
  • Download Images from Pinterest
  • Download Media from Twitter
  • User-Friendly Interface with CustomTkinter

Installation

  1. Clone the repository:
    git clone https://github.com/MSC72m/social-media-toolkit.git
    cd social-media-toolkit

Create a virtual environment (optional but recommended):

python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

Install Required Libraries:

   pip install requests beautifulsoup4 customtkinter pytube instaloader threading random

Usage

Run the application:

python main.py

Enter a URL in the input field of the GUI and click the "Analyze URL and Download" button.

Disclaimer

Instagram has 12 anonymous download limit, if you encounter 401 errors it's because of that.

caution

Meta is sensitive to scraping methods, In inorder to limit the risk of getting your main account banned, preferably create a fake Instagram account and use that to download media. if you don't download near the 1000 download limit daily, the risk of getting banned is lower but still, it's recommended to use a fake account for this perpose

Add Your Username && Password

  1. navigate to the project directory.

  2. Open the script file.

  3. Replace the entire download_instagram_video function in your script with the following code:

    def download_instagram_video(link, username='your_username', password='your_password'):
        loader = instaloader.Instaloader()
      """ replacing the function with this and replacing the username and password you won't have 401 error and 12 item rate limit will be lifted to 1000 """
        # Login to Instagram
        try:
            loader.login(username, password)
        except instaloader.exceptions.BadCredentialsException:
            messagebox.showerror("Error", "Invalid username or password.")
            on_operation_done() 
            return
        except instaloader.exceptions.ConnectionException:
            messagebox.showerror("Error", "Connection error, please check your internet connection.")
            on_operation_done()  # Callback to re-enable the button
            return
        except Exception as e:
            messagebox.showerror("Error", f"An unexpected error occurred: {e}")
            on_operation_done()  
            return
    
        try:
            post = instaloader.Post.from_shortcode(loader.context, link.split('/')[-2])
            video_url = post.video_url
            download_video(video_url, f"downloaded_instagram_video{save_path}.mp4")
            messagebox.showinfo("Success", "Video downloaded successfully.")
            on_operation_done() 
        except Exception as e:
            messagebox.showerror("Error", f"Error downloading Instagram video: {e}")
            on_operation_done() 
  4. Replace 'your_username' and 'your_password' with your Instagram login credentials in the download_instagram_video function.

  5. Run the script:

    python main.py

By following these instructions, users will be able to download more than the anonymous limit of 12 files by logging in with their Instagram credentials (it will have a 1000-item limit).

Requirements

  • Python 3.x
  • Required libraries:
    • requests
    • beautifulsoup4
    • re
    • customtkinter
    • tkinter
    • pytube
    • instaloader
    • threading
    • random

Troubleshooting

Network Issues:

If you encounter network-related errors, ensure you have a stable internet connection and try again.

Unsupported URL:

If you see an "Unsupported URL" warning, make sure the URL is from one of the supported domains (Instagram, YouTube, Pinterest, Twitter).

Error Messages:

Error messages will be displayed in a message box if any issues occur during the download process. Review these messages to understand what went wrong.

Contributing

Contributions are welcome! Please create an issue or submit a pull request for any improvements or new features.

About

This handy application is designed to make downloading videos and images from various social media platforms a breeze. Whether you're looking to save a memorable Instagram video, a high-resolution YouTube clip, a Pinterest image, or media from Twitter, this toolkit has got you covered.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages