Previously, this would error whenever a message without a first argument was present in irc.state.history.
ERROR 2015-12-17T21:12:51 Uncaught exception in _callRegexp:
Traceback (most recent call last):
File "/home/gl/.local/lib/python3.4/site-packages/supybot/callbacks.py", line 1457, in _callRegexp
method(irc, msg, m)
File "/home/gl/SupyPlugins/Replacer/plugin.py", line 116, in replacer
if m.args[0] == msg.args[0] and \
IndexError: tuple index out of range
ERROR 2015-12-17T21:12:51 Exception id: 0x2b96f
This pretends a slew of "cannot send to channel" errors and possible excess floods whenever the bot is starting, as different networks connect at their own pace.
Essentially, my reimplementation of krf/supybot-lastfm#8. Instead of using YouTube's API (which requires API keys and all that), this performs web search on site:youtube.com using the DDG (DuckDuckGo) plugin in this repository. The advantage to this is that it's simpler to set up, but results may not always be the most accurate / relevant.
This behavior can be turned on by setting supybot.plugins.LastFM.fetchYouTubeLinks to True - it defaults to off since this is experimental anyways. The DDG plugin needs to be loaded too for this to work.
Also, only bold the album/artist/track data during output formatting, NOT before (this screws up searches with all the \x02's).
Example for this is the article for "Fallstreak hole", where the old behavior would create incorrect results when an <a> tag is nested at the beginning of a <b> tag.
Bad:
<Lily> A Nonefallstreak hole, also known as a hole punch cloud, punch hole cloud, skypunch, canal cloud or cloud hole, is a large circular or elliptical gap that can appear in cirrocumulus or altocumulus clouds. Such holes are formed when the water temperature in the clouds is below freezing but the water has not frozen yet due to the lack of ice nucleation (see supercooled water). When ice crystals do form it will set off a (1 more message)
Better:
<Lily> A fallstreak hole, also known as a hole punch cloud, punch hole cloud, skypunch, canal cloud or cloud hole, is a large circular or elliptical gap that can appear in cirrocumulus or altocumulus clouds. Such holes are formed when the water temperature in the clouds is below freezing but the water has not frozen yet due to the lack of ice nucleation (see supercooled water). When ice crystals do form it will set off a (1 more message)