Package: dlsite-async
DLsite AsyncFeaturesAsync DLsite API for fetching work metadataSupports most DLsite sites:Comipo (comic)Doujin (All-ages/home, Adult/maniax)Adult comics (books)All-ages games (soft)Galge (pro)Apps (appx)Supports common metadata for most DLsite work typesJapanese and English locale support
(English metadata may not be available for all works)Async DLsite Play APISupports downloading web-optimized versions of works from DLsite PlayDownloads require valid DLsite account login (only purchased works can be
downloaded)Onlyoptimizedfile versions can be downloadedImages may be resized to smaller resolution and compressedAudio files may be re-encoded and compressed into MP3 formatVideo files may be resized to smaller resolution and re-encodedPlay API returns an m3u8 HLS stream playlist for videos. Downloading the
HLS video segments is not supported.Supports de-scrambling downloaded images (from book type works)Image de-scrambling requires installation withdlsite-async[pil]RequirementsPython 3.9+InstallationYou can installDLsite AsyncviapipfromPyPI:$pipinstalldlsite-asyncCertain features require may installing extra dependencies:$pipinstalldlsite-async[pil]Usage examplesFetch manga information:>>>importasyncio>>>fromdlsite_asyncimportDlsiteAPI>>>asyncdeff():...asyncwithDlsiteAPI()asapi:...returnawaitapi.get_work("BJ370220")...>>>asyncio.run(f())Work(product_id='BJ370220',site_id='comic',maker_id='BG01675',work_name='衛宮さんちの今 日のごはん (6)\u3000レシピ本付特装版',age_category=<AgeCategory.ALL_AGES:1>,circle=None,brand=None,publisher='KADOKAWA',work_image='//img.dlsite.jp/.../BJ370220_img_main.jpg',regist_date=datetime.datetime(2021,10,28,0,0),work_type=<WorkType.MANGA:'MNG'>,book_type=<BookType.BOOK:'comic'>,...author=['TAa','只野まこと','ＴＹＰＥ−ＭＯＯＮ'],...genre=['少年コミック','ギャグ','コメディ','ほのぼの'],label='KADOKAWA',...page_count=307)Fetch English voice/ASMR information:>>>asyncdeff():...asyncwithDlsiteAPI(locale="en_US")asapi:...returnawaitapi.get_work("RJ294126")...>>>asyncio.run(f())Work(product_id='RJ294126',site_id='maniax',maker_id='RG51931',work_name='Pure Pussy on Duty',age_category=<AgeCategory.R18:3>,circle='aoharu fetishism',brand=None,publisher=None,work_image='//img.dlsite.jp/.../RJ294126_img_main.jpg',regist_date=datetime.datetime(2020,8,30,0,0),work_type=<WorkType.VOICE_ASMR:'SOU'>,...illustration=['ぬこぷし'],voice_actor=['逢坂成美'],...genre=['Healing','Dirty Talk','Binaural','ASMR',...],...file_format=['WAV'],file_size='Total 010.63GB',...)List DLsite Play files in a work:>>>fromdlsite_asyncimportPlayAPI>>>asyncdeff():...asyncwithPlayAPI()asplay_api:...awaitplay_api.login("username","password")...token=awaitplay_api.download_token("RJ294126")...tree=awaitplay_api.ziptree(token)...returndict(tree.items())...>>>asyncio.run(f()){'純愛おま○こ当番【アップデート版】/readme.txt':PlayFile(length=4006,type='text',files={'optimized':{'encoding':'UTF-8','length':5232,'name':'95b8dd8e45a2ff0b1d45717b93a096b7.txt','size':'5.1KB'}}),...,'純愛おま○こ当番【アップデート版】/02_wav/track00_タイトルコール.wav'PlayFile(length=5193978,type='audio',files={'optimized':{'bit_rate':74182,'duration':6.768,'length':62758,'name':'069498e95c11ad47fc65ee87a1a0ae60.mp3','size':'61.3KB'}}),...,'純愛おま○こ当番【アップデート版】/04_omake/01：高画質画像/junai_r_01.jpg':PlayFile(length=1394068,type='image',files={'files':{'crypt':False,'height':3000,'length':1394068,'name':'d0b8bc7a93e4f1c4c3d5e3eed6d65393.jpg','size':'1.3MB','width':2143},'optimized':{'crypt':True,'height':1280,'length':220746,'name':'d0b8bc7a93e4f1c4c3d5e3eed6d65393.jpg','size':'215.6KB','width':914}}),...,'純愛おま○こ当番【アップデート版】/05_字幕付き音声動画/trackEX_おま○こ当番と体育倉庫でナイショえっち.mp4':PlayFile(length=297495132,type='video',files={'files':{'frame_rate':'24/1','height':1080,'width':1920},'optimized':{'duration':'1004.693333','name':'d5e47f10d9d98944f6d4003497087c53.m3u8','streams':['v720p','v480p','v240p']}}),...,}Download web-optimized images from a manga/comic work to the current working directory
(Note that usingdescramble=Truerequiresdlsite_async[pil]):>>>importos>>>importasyncio>>>fromdlsite_asyncimportPlayAPI>>>asyncdeff():...asyncwithPlayAPI()asplay_api:...awaitplay_api.login(username,password)...token=awaitplay_api.download_token("BJ277832")...tree=awaitplay_api.ziptree(token)...forfilename,playfileintree.items():...ifplayfile.type!="image":...continue...orig_path,_=os.path.splitext(filename)..._,ext=os.path.splitext(playfile.optimized_name)...dest=f"{orig_path}{ext}"...awaitplay_api.download_playfile(...token,playfile,dest,mkdir=True,descramble=True...)...>>>asyncio.run(f())ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,DLsite Asyncis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.