Giter Club home page Giter Club logo

filescrapper's Introduction

FileScrapper ~ Downloading become easy ;)

Languages-Java Instagram - x__coder__ GitHub Repo stars

This is an android library (aar) by which you can use any file hosting service as an alternative to firebase storage. Alternative because you can only download files, you can't upload (will be available in future). You can download files from Mediafires, Drive, Anonfiles (more in next release).

Implementation

In your project build.gradle

  allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

In your module (app) build.gradle

dependencies {
	        implementation 'com.github.ErrorxCode:FileScrapper:1.0'
	}

Usage / Examples

To download a file from google drive :-

 try {
      boolean success = FileScrapper.download(Provider.DRIVE,"https://drive.google.com/file/d/13XLRUKgU-O_qrGbpM9GcafRGkHU8Rxq9/view?usp=sharing", Environment.DIRECTORY_DOWNLOADS);
    } catch (DriveException e) {
        e.printStackTrace();
    }

You can select between Provider.DRIVE, Provider.ANONFILES, Provider.MEDIAFIRE.

To get final download link :-

 try {
      String link = FileScrapper.getDownloadLink(Provider.MEDIAFIRE,"https://www.mediafire.com/file/zg8qixmkuym04j6/1.5.0_NO_GRASS_%252B_90_FPS_CONFIG.zip/file");
      // Manually download or fire this link in browser.
    } catch (DriveException e) {
        e.printStackTrace();
    }

API Reference

Method Return type Description
getDownloadLink(Provider provider,String link) string This method return's the final download of link of the file which is given by the provider.
download(Provider provider,String link,String download_directory) boolean This method download file from the link synchronously.
downloadInBackground(Provider provider,String link,String download_directory) boolean This method download's the file in a background thread. Calling this is equivalent to calling download(Provider, String, String) in a separate thread
downloadWithProgress(Context context,Provider provider,String link,String download_directory) boolean This method download's the file synchronously in a separate thread. This method also shows an progress dialog while downloading the file. You don't need to put this in thread or async task
downloadWithNotification(@NonNull Context context,Provider provider,String link,String download_directory,String title,String description) boolean This method use android DownloadManager to download the file. This also shows the notification of the download.

Thanks for using my library ๐Ÿ™๐Ÿ’™

filescrapper's People

Contributors

errorxcode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.