All Projects → aryanvikash → Pyaiodl

aryanvikash / Pyaiodl

Licence: other
A python Asynchronous Downloader - Pyaiodl

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyaiodl

asyncio-socks-server
A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio.
Stars: ✭ 154 (+285%)
Mutual labels:  asynchronous, pypi
Kubernetes asyncio
Python asynchronous client library for Kubernetes http://kubernetes.io/
Stars: ✭ 147 (+267.5%)
Mutual labels:  asynchronous, aiohttp
duckpy
A simple Python library for searching on DuckDuckGo.
Stars: ✭ 20 (-50%)
Mutual labels:  asynchronous, pypi
feedsearch-crawler
Crawl sites for RSS, Atom, and JSON feeds.
Stars: ✭ 23 (-42.5%)
Mutual labels:  pypi, aiohttp
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+5882.5%)
Mutual labels:  downloader, pypi
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+857.5%)
Mutual labels:  downloader, aiohttp
Purerpc
Asynchronous pure Python gRPC client and server implementation supporting asyncio, uvloop, curio and trio
Stars: ✭ 125 (+212.5%)
Mutual labels:  asynchronous, pypi
CoubDownloader
A simple downloader for coub.com
Stars: ✭ 64 (+60%)
Mutual labels:  downloader, aiohttp
Aget
Aget - An Asynchronous Downloader
Stars: ✭ 121 (+202.5%)
Mutual labels:  downloader, asynchronous
Youtube Dl Gui
A cross platform front-end GUI of the popular youtube-dl written in wxPython.
Stars: ✭ 7,914 (+19685%)
Mutual labels:  downloader, pypi
cashews
Cache with async power
Stars: ✭ 204 (+410%)
Mutual labels:  asynchronous, aiohttp
torequests
Async wrapper for requests / aiohttp, and some crawler toolkits. Let synchronization code enjoy the performance of asynchronous programming.
Stars: ✭ 22 (-45%)
Mutual labels:  asynchronous, aiohttp
PromisedFuture
A Swift based Future/Promises framework to help writing asynchronous code in an elegant way
Stars: ✭ 75 (+87.5%)
Mutual labels:  asynchronous
node-wetransfert
Download wetransfert content with nodeJS
Stars: ✭ 16 (-60%)
Mutual labels:  downloader
feupy
The sigarra scraping library no one asked for
Stars: ✭ 13 (-67.5%)
Mutual labels:  pypi
ngDownloader
📹 🎥 Now Download videos from any website including YouTube, Facebook, Udemy etc without ads.
Stars: ✭ 47 (+17.5%)
Mutual labels:  downloader
downloader
Async rate-limited downloading service
Stars: ✭ 18 (-55%)
Mutual labels:  downloader
aiohttp-three-template
Project template for Python aiohttp three-tier web applications
Stars: ✭ 20 (-50%)
Mutual labels:  aiohttp
eventsourcing-go
Event Sourcing + CQRS using Golang Tutorial
Stars: ✭ 75 (+87.5%)
Mutual labels:  asynchronous
anghamify
Anghami Downloader | Download Anghami songs with full meta-tags.
Stars: ✭ 22 (-45%)
Mutual labels:  downloader

Python Asynchronous Downloader - pyaoidl

Don't Use it in Production or Live Projects Currently Its Unstable


Python 3.6 Maintenance PyPI license Open Source Love png3 Hits


Version

Beta badge

PyPI version

installation

pypi Method (Recommended)

pip3 install pyaiodl

Github repo method

pip3 install git+https://github.com/aryanvikash/pyaiodl.git

Available Methods

  • Downloader class Instance Non-blocking , params = [fake_useragent:bool,chunk_size:int ,download_path:str] optinals

      dl = Downloader()
    
  • Download [ download(self,url) ]

    uuid = await dl.download(url)
    
  • Errors [iserror(self, uuid)] : Returns - Error Or None , Even On cancel It returns an error "{uuid} Cancelled"

    await dl.iserror(uuid)
    
  • cancel [ cancel(self, uuid) ]

     await dl.cancel(uuid)
    
  • Get Status [ status(self, uuid) ]

      response = await dl.status(uuid)
      
    
    
      returns a dict
    
      """
      filename:str
      file_type :str
      total_size :int
      total_size_str : str
      downloaded :int
      downloaded_str :str
      progress:int
      download_speed:str
      complete :bool
      download_path:str
    
      """
    
  • is_active returns : bool [ is_active( self,uuid ) ] - on cancel ,error , download complete return False

      result = await dl.is_active(uuid)
    

Usage

Example :


from pyaiodl import Downloader, errors
import asyncio
url = "https://speed.hetzner.de/100MB.bin"


async def main():
    dl = Downloader()
    # you can pass your
    # custom chunk size and Download Path
    # dl = Downloader(download_path="/your_dir/", chunk_size=10000)
    uuid = await dl.download(url)
    try:
        while await dl.is_active(uuid):

            r = await dl.status(uuid)

               #cancel
            if r['progress'] > 0:
                try:
                    await dl.cancel("your_uuid")
                except errors.DownloadNotActive as na:
                    print(na)


            print(f"""
            Filename: {r['filename']}
            Total : {r['total_size_str']}
            Downloaded : {r['downloaded_str']}
            Download Speed : {r['download_speed']}
            progress: {r['progress']}
             """)

            # let him breath  for a second:P
            await asyncio.sleep(1)

    # If You are putting uuid  manually Than its better handle This Exception
    except errors.InvalidId:
        print("not valid uuid")
        return

    # when loop Breaks There are 2 Possibility
    # either Its An error Or Download Complete
    # Cancelled Is also count as error
    if await dl.iserror(uuid):
        print(await dl.iserror(uuid))

    else:
        # Final filename / path
       print("Download completed : ", r['download_path'])


asyncio.get_event_loop().run_until_complete(main())

known Bugs -

  • None Please Report :)

TODO

  • Multipart Download
  • Queue Download / Parallel Downloads Limit
  • Better Error Handling

Thanks ❤️


Powered badge

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].