Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. """
  2. Fetch the yt comments using this tool
  3.  
  4. https://github.com/egbertbouman/youtube-comment-downloader
  5.  
  6. After installing the dependencies
  7.  
  8. Run this command
  9.  
  10. python .\downloader.py --youtubeid WX8dswSDQqM --output file.json
  11.  
  12. Finally run this script
  13. """
  14.  
  15. texts = []
  16. ammount = 0;
  17.  
  18. for line in open("file.json", encoding='utf8'):
  19.     texts.append(line)
  20.  
  21. size = len(texts)
  22. keywords = ["ttk", "revert", "5.2", "cheat", "implement", "balance", "team"]
  23. for line in texts:
  24.     string = str(line).lower()
  25.     for keyword in keywords:
  26.         if keyword in string:
  27.             ammount +=1
  28.             break
  29. print('Total comments : ', size)
  30. print('Ammount of complaints : ', ammount)
  31. print('Percentage : {:0.2f}%'.format(ammount/size*100))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement