Code Monkey home page Code Monkey logo

arandabot's People

Contributors

aaronchall avatar alexbragdon avatar notatallshaw avatar victorfour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arandabot's Issues

Create common client_secrets.json for everyone to use

A common cient_secrets.json will be kept in the git repository. It will be used unless there exists a user cient_secret*.json in the bot directory.

The code will ignore provided settings when using common client_secrets.json, it will limit caling youtube to once every 60 seconds. There will be no obfuscation, if some user chooses to break it, that is up to them.

Another exception to catch

Traceback (most recent call last):
File "main.py", line 19, in
main()
File "main.py", line 16, in main
arandabot.arandabot(settings=settings)
File "C:\Users\Damian\Documents\arandabot - prod\arandabot.py", line 46, in arandabot
yt.getNewestVideos()
File "C:\Users\Damian\Documents\arandabot - prod\ytvideos.py", line 246, in getNewestVideos
self.youtube = self.initilize_youtube(self.set)
File "C:\Users\Damian\Documents\arandabot - prod\ytvideos.py", line 119, in initilize_youtube
http=credentials.authorize(httplib2.Http()))
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(_args, *kwargs)
File "C:\Python27\lib\site-packages\apiclient\discovery.py", line 192, in build
resp, content = http.request(requested_url)
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(args, *kwargs)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 490, in new_request
redirections, connection_type)
File "C:\Python27\lib\site-packages\httplib2__init
.py", line 1593, in request
(response, content) = self.request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "C:\Python27\lib\site-packages\httplib2__init
.py", line 1335, in request
(response, content) = self.conn_request(conn, request_uri, method, body, headers)
File "C:\Python27\lib\site-packages\httplib2__init
.py", line 1291, in _conn_request
response = conn.getresponse()
File "C:\Python27\lib\httplib.py", line 1061, in getresponse
raise ResponseNotReady()
httplib.ResponseNotReady

Add a walkthrough script in main.py

Make it much easier to set up for the first time by adding an interactive walk through script, allowing user to put in username and password and channel configuration details of for the script to handle the saving to json

Print stack trace when catching unexpected exception

Currently got an error like this and not sure where it came from:

Some unexpected exception occured in arandabot backing off for 5 mins and trying
again:
'charmap' codec can't encode character u'\u2019' in position 38: character maps
to

Another another exception to catch

Affects both main and search branch:

Traceback (most recent call last):
File "main.py", line 19, in
main()
File "main.py", line 16, in main
arandabot.arandabot(settings=settings)
File "C:\Users\Damian\Documents\arandabot - prod - search\arandabot.py", line46, in arandabot
yt.getNewestVideos()
File "C:\Users\Damian\Documents\arandabot - prod - search\ytvideos.py", line 251, in getNewestVideos
self.youtube = self.initilize_youtube(self.set)
File "C:\Users\Damian\Documents\arandabot - prod - search\ytvideos.py", line 120, in initilize_youtube
http=credentials.authorize(httplib2.Http()))
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(_args, *kwargs)
File "C:\Python27\lib\site-packages\apiclient\discovery.py", line 192, in build
resp, content = http.request(requested_url)
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(args, *kwargs)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 490, in new_request
redirections, connection_type)
File "C:\Python27\lib\site-packages\httplib2__init
.py", line 1593, in request
(response, content) = self.request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "C:\Python27\lib\site-packages\httplib2__init
.py", line 1335, in request
(response, content) = self.conn_request(conn, request_uri, method, body, headers)
File "C:\Python27\lib\site-packages\httplib2__init
.py", line 1263, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at www.googleapis.com

Multi-Thread the youtube requests

Once the number of subscription channel requests has got very large it is very slow to loop around getting all the user upload playlists. Should add option to multi-thread this step.

Update to PRAW 3.0

Will need to depreciate password login to reddit in favor of ouath 2.0

Move away from using uploaded timestamp to track if videos are new

It's a little unreliable, instead keep a list of videos IDs already posted.

Things to consider:

  1. How big is the list allowed to get?
  2. Is the list saved to file?
  3. How do we use it to determine if we no longer need to search older videos? (I was thinking of having a confidence value, e.g. if more than 50% of videos on this search are already in our list, no need to check out older videos)

Create settings.template.json

This will be used to populate all the default values and be kept in the git repository. If settings.json is not in the directory of the bot it will create it based of settings.tempate.json and user input from various questions.

settings.json will be added to the git ignore file so people's secret details (such as reddit username/password) aren't accidentally uploaded)

Add timeouts to ytvideos class methods

I think sometimes the Google API classes just stop responding as apposed to throwing an exception. The idea to this would to be put the calls in to a separate thread / subprocess and kill the thread after a set amount of time if nothing happens.

Maybe measuring "nothing happens" could be via a queue which is populated by the loops in the method.

Use requirements.txt instead of noting dependencies in readme

Currently dependencies are noted in the readme.md of this project, the more 'pythonic' and maintainable way to do this would be to pipe the requirements into a requirements.txt file.

You generate this by running the following command:
pip freeze >requirements.txt

commit the requirements file to your repo.

Then anyone can install all your dependencies by running:
pip install -r requirements.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.