こんにちは、haniokasaiです。
https://forum.pmmp.jp が廃止になるため、慌ててデータを落としたくなりました。
https://github.com/haniokasai/XenDownloder
こちら。
import cfscrape
これで、ふつーのテキスト的な感じでダウンロードできます。
https://forum.pmmp.jp が廃止になるため、慌ててデータを落としたくなりました。
https://github.com/haniokasai/XenDownloder
こちら。
import cfscrape
scraper = cfscrape.create_scraper() | |
print scraper.get("https://forum.pmmp.jp/").content | |
res = scraper.get("https://forum.pmmp.jp/attachments/" + str(i) + "/", stream=True) | |
fname = re.findall("filename=(.+)", res.headers['content-disposition']) #ファイル名を取得します。 | |
parsedfname = fname[0].replace("\"", "") | |
#phar名編集 | |
\ | |
if res.status_code == 200: | |
with open(parsedfname, 'wb') as file: | |
for chunk in res.iter_content(chunk_size=1024): | |
file.write(chunk) |
こちらのコードで、ファイルを保存できます。
これで、cloudflareがあってもdlできます。
参考;https://torina.top/detail/161/