Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python script for grabbing all the Q images from qanon.news:
- @_Luke_Slytalker
- #########################################################################
- # USE: python qimage.py JPG_LIST.txt PNG_LIST.txt
- # save all the Q image links into a text files and output the entire list.
- import sys, os, json, requests
- jobj = requests.get("https://qanon.news/json/analytics/_analytic_fn0.json").json()
- output_list = ''
- jpg_list = ''
- png_list = ''
- jpgfile = sys.argv[1]
- pngfile = sys.argv[2]
- for p in jobj:
- img_link = p['link']
- output_list += 'https://qanon.news/images/' + img_link + '\n'
- # add some separators for PNG vs JPG
- if '.jp' in img_link:
- # add to the JPG list
- jpg_list += 'https://qanon.news/images/' + img_link + '\n'
- elif '.png' in img_link:
- # add to the PNG list
- png_list += 'https://qanon.news/images/' + img_link + '\n'
- print(output_list)
- # output the entire list
- # ( incase someone wants to qimage.py JPG PNG > FULL.txt )
- # save the JPGs to the user specified file
- with open(jpgfile, 'w') as jpg:
- jpg.write(jpg_list)
- # save the PNGs to the user specified file
- with open(pngfile, 'w') as png:
- png.write(png_list)
- #########################################################################
- BASH script to download all the images from a list
- #!/bin/bash
- # always like to remind myself that I can
- # do things with BASH, too (instead of Python lol)
- thefile=$1 # grab the file from the command line input
- # read the file, line by line, until it's done (out of lines)
- while IFS= read -r line
- do
- echo "$line"
- # print the line to the console
- wget -P ~/Desktop/qimages/ $line
- # download to a folder on your desktop called 'qimages'
- # (you might want to change this part)
- done < $thefile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement