Coder Social home page Coder Social logo

yukari's People

Contributors

d-dd avatar twirlie avatar zig-for avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

twirlie zig-for

yukari's Issues

$thank

You're welcome.

??

Should only respond to specific args such as "you." and "you %s" % name

IRC reconnect

[IrcClient] Connection Lost to IRC. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection to the other side was lost in a non-clean fashion.

SMS reminder

with textbelt.com
weekly reminder
$sms phonenumber

Message for $blacklist

Display message when:
-video gets blacklisted
-a blacklisted video is added (removed).

Youtube restricted regions

Since youtube blocks a lot of videos in the US now, add a requirement that video must be viewable in US (can add region codes in settings).

check irc chat order

Saw an answer before the prompt yesterday on irc

[question] Yes.
$ask question.

$vote replay not quite right

I think it tally's non-replay polls too (polls other people made) and somehow tries to count the results of those.

$replay

Sets media to replay (once) mode.
When it finishes it will be played again.

Trying to 'jumpTo' before changeMedia by estimating remaining runtime is too unreliable. Waiting for changeMedia is better, but remaining time still needs to be monitored to differentiate between user initiated changeMedia (which replay will be cancelled) or a natural changeMedia (will be replayed).
Also if changeMedia is 'correct' (someone sets it for us), then replay will be cancelled.

What would be easier is to queue two videos, but channels disallow duplicate media by default.
Another workaround is to move the media down after it finished playing, so it would replay after one video. But that's not really the same.

spam part II

Looks like IRC is the problem this time.
Yukari was excess flood kicked... The now playing and status messages probably count against the anti-flood.

--- ---
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 214, in doRead
return self._dataReceived(data)
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 220, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/twisted/websocket.py", line 96, in dataReceived
self._dataReceived(data)
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1328, in _dataReceived
self.consumeData()
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1344, in consumeData
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1503, in processData
return self.processDataHybi()
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1817, in processDataHybi
fr = self.onFrameEnd()
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1947, in onFrameEnd
self._onMessageEnd()
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/twisted/websocket.py", line 132, in _onMessageEnd
self.onMessageEnd()
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 743, in onMessageEnd
self._onMessage(payload, self.message_is_binary)
File "/home/dd/.virtualenvs/yuka/local/lib/python2.7/site-packages/autobahn/twisted/websocket.py", line 136, in _onMessage
self.onMessage(payload, isBinary)
File "/home/dd/mikumonday/Yukari/connections/cytube/cyClient.py", line 245, in onMessage
self.processFrame(fdict)
File "/home/dd/mikumonday/Yukari/connections/cytube/cyClient.py", line 299, in processFrame
thunk(fdict)
File "/home/dd/mikumonday/Yukari/connections/cytube/cyClient.py", line 383, in _cyCall_chatMsg
self.factory.handle.recCyMsg('chat', username, msg, False, action)
File "yukari.py", line 193, in recCyMsg
self.sendToIrc(cleanMsg)
File "yukari.py", line 251, in sendToIrc
self.ircFactory.prot.sendChat(msg, action)
exceptions.AttributeError: IrcFactory instance has no attribute 'prot'

Race condition in sustainloop

"Z:\dev\Yukari\connections\cytube\cyClient.py", line 1187, in sustainQueue mType, mId = self.queueMediaList.popleft() exceptions.IndexError: pop from an empty deque

The stop condition is being checked on the instance-wide name, which can lead to race condition.

if not self.queueMediaList:

$version

With maybe a text file that needs to be updated each commit, or something automatic that shows the git hash.

This is to check which version is running, so we know if we already restarted Yukari or not after a git pull.

$vote replay

It doesn't set replay after poll is over.
-double check ratios and boolean flag.

-Also some cases:
1)When Yukari opens the poll, but during the poll someone sets $replay
a)In this case, it should close the poll.
2) When someone closes the poll, "disregard message" appears - is this cancelling the replay? Clearing 1a should resolve this.

check: $vote replay errors when it is already set to replay (pretty sure it already does)

Add queue count in announce_queue

username has added next (10): title!

10th time this has been queued.
Not by user, just in general.

Oh, also put a tiny delay so queues can be collected:
username has added 5 videos!; etc.

$bye

check points for $bye; think of something for > 5000 points, also add $goodnight.

database write error

during spam yukari had database write errors
I think it was "cannot have null for userid" or something close to it. Possibly there was another error before that that caused a restart, and a lot of spam when she joins causes this error.

Word wrap IRC messages

Word wrap IRC messages instead of breaking up characters mid-word.
a very long IRC chat message should break off [..]
like this.

loguserinout happens twice (cyclient.py)

We call it when we shut down, and it is also called in the reconnect portion of cytube factory.
Luckily the assert statement was raised and data was never double logged.

revamp how $add selects media

The issue with $add right now is that it:

  1. doesn't take into account media already in the playlist (adding will result in duplicate error)
  2. doesn't take into account media that gets deleted due to it being unplayable.

It would be better if $add -n 5 would always add 5 videos to the list.

  1. One way is to select n + buffer number of videos. If a video is already in the playlist we add more from the buffer.
    Another method is to re-SELECT more videos if there is a shortage. This should only happen once or twice to prevent it from looping.

Sometimes (especially when we do specific searches) we have to repeat the $add command, because the RNG may keep selecting videos that are already in the playlist. It's probably a bad idea to filter the actual SQL with media id's that are already in the playlist. It's also a bad idea to select everything before filtering it out in Python, unless the result is small.

$vote replay caused this

File "/home/pi/venv/local/lib/python2.7/site-packages/autobahn/twisted/websocket.py", line 138, in _onMessage
self.onMessage(payload, isBinary)
File "/home/pi/mikumonday/Yukari/connections/cytube/cyClient.py", line 138, in onMessage
self.processFrame(fdict)
File "/home/pi/mikumonday/Yukari/connections/cytube/cyClient.py", line 185, in processFrame
thunk(fdict)
File "/home/pi/mikumonday/Yukari/connections/cytube/cyClient.py", line 1344, in _cyCall_changeMedia
self.doClosePoll()
File "/home/pi/mikumonday/Yukari/connections/cytube/cyClient.py", line 527, in doClosePoll
self.sendf({'name': 'closePoll'})
File "/home/pi/mikumonday/Yukari/connections/cytube/cyClient.py", line 145, in sendf
l = '["%s",%s]' % (fdict["name"], json.dumps(fdict["args"]).encode('utf8'))
exceptions.KeyError: 'args'

handle Database locks

The adbapi only uses one thread so it never locks itself, but if something else is using it (reading table with sqlite3), it can sometimes lock.

Rotate profile text and profile image url each connect.

  1. need a new table with text and img urls
  2. Each connect, unset flag (last used), and set a flag on the next row
    Yukari needs to update before joining.
  3. $profile words, url ... maaaaybe
    In the future CyTube may return the profileUpdate frame, but until then this is fine.

$vote

Democracy!!!
Makes polls.
$vote replay #14
$vote shuffle
$vote leader (?)
$vote kick (?)
$vote lock/unlock (?)
$vote anything else?
mmods can retire soon~ (actually they have to type the $vote command)

Each poll type has a ratio which must be satisfied for the event to occur (e.g. 3:1 votes for a replay).

Each poll will have a timer. It will be controlled by Yukari instead of the Cytube server. This leaves us the option to add more time if necessary.

An option (maybe -s) is available to limit Yukari to just making the poll, and nothing more (not even ending the poll).

$reprint catch bad errors

I think anything that doesn't return a smid dl link just disables $reprint right now:
Catch some exceptions such as:
-deleted video
-bad id

etc...

reject rejected youtube vids

"status": {
"uploadStatus": "rejected",
"rejectionReason": "uploaderAccountSuspended",
"privacyStatus": "public",
"license": "youtube",
"embeddable": true,
"publicStatsViewable": true
}

Cytube user join / leave to an IRC channel

Similar to now playing IRC channel, channel-status channel will be moderated (+m) and no users except Yukari will have voice. This is meant to be used with a script so there isn't a big focus on message readability.

Yukari will announce:
user part
user join
full userlist*

This channel might be used for other status messages in the future.

*When yukari joins channel, when IRC gets throttled, when Cytube is under spam and commands are ignored

Clients are responsible for differentiating cytube and irc names and handling name clashes.

For the time being Yukari will use the same nickname as main chat/ now playing.

$history for IRC

IRC command (no PM's) that PM's caller with the last 15 lines of chat history.

Support channels with duplicate media enabled

Yukari assumes each video is unique, so videos are often searched by (type, id). Since playlist is a list it probably searches for the first match, and selects that video.

Look for places where this may be problematic on channels that allow duplicates and fix them.

IRC -> Cytube chat multiline

IRC character limit per line is greater than Cytube character limit. When someone types a long line in IRC Yukari should split it as necessary.

Improve $add

Add an argument for $add that lets users adds old videos (last queue > 6 months, biased towards older videos) that a user liked/queued/added in the past.

Timezone aware $greet

Good morning, hello, good afternoon, good evening, hello.
$settz -9

Don't worry about daylight saving.

omit needs some feedback

$omit [type, id] could use some feedback. Currently you can only check if it was successfully omitted when the video is playing.

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.