Advertisement
Guest User

Untitled

a guest
May 23rd, 2020
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. Python script for grabbing all the Q images from qanon.news:
  2. @_Luke_Slytalker
  3.  
  4. #########################################################################
  5. # USE: python qimage.py JPG_LIST.txt PNG_LIST.txt
  6. # save all the Q image links into a text files and output the entire list.
  7.  
  8. import sys, os, json, requests
  9.  
  10. jobj = requests.get("https://qanon.news/json/analytics/_analytic_fn0.json").json()
  11.  
  12. output_list = ''
  13. jpg_list = ''
  14. png_list = ''
  15.  
  16. jpgfile = sys.argv[1]
  17. pngfile = sys.argv[2]
  18.  
  19. for p in jobj:
  20. img_link = p['link']
  21. output_list += 'https://qanon.news/images/' + img_link + '\n'
  22. # add some separators for PNG vs JPG
  23. if '.jp' in img_link:
  24. # add to the JPG list
  25. jpg_list += 'https://qanon.news/images/' + img_link + '\n'
  26. elif '.png' in img_link:
  27. # add to the PNG list
  28. png_list += 'https://qanon.news/images/' + img_link + '\n'
  29.  
  30. print(output_list)
  31. # output the entire list
  32. # ( incase someone wants to qimage.py JPG PNG > FULL.txt )
  33.  
  34. # save the JPGs to the user specified file
  35. with open(jpgfile, 'w') as jpg:
  36. jpg.write(jpg_list)
  37. # save the PNGs to the user specified file
  38. with open(pngfile, 'w') as png:
  39. png.write(png_list)
  40.  
  41. #########################################################################
  42.  
  43. BASH script to download all the images from a list
  44.  
  45. #!/bin/bash
  46. # always like to remind myself that I can
  47. # do things with BASH, too (instead of Python lol)
  48.  
  49. thefile=$1 # grab the file from the command line input
  50.  
  51. # read the file, line by line, until it's done (out of lines)
  52. while IFS= read -r line
  53. do
  54. echo "$line"
  55. # print the line to the console
  56. wget -P ~/Desktop/qimages/ $line
  57. # download to a folder on your desktop called 'qimages'
  58. # (you might want to change this part)
  59. done < $thefile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement