Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- import requests
- url = "https://2ch.hk/b/res/262396698.json"
- thread_content = requests.get(url)
- json_data = json.loads(thread_content.text)
- for thread in json_data['threads']:
- for post in thread['posts']:
- for file in post['files']:
- file_name = file['name']
- full_url = "https://2ch.hk/" + file['path']
- r = requests.get(full_url, allow_redirects=False)
- open(file_name, 'wb').write(r.content)
Add Comment
Please, Sign In to add comment