teeli / urltitle

Eggdrop scripts that display titles of URLs pasted on an IRC channel
MIT License
8 stars 10 forks source link

Errors since latest update #7

Closed voidzero closed 7 years ago

voidzero commented 7 years ago

I'm getting these errors on the partyline:

<Bot> [20:08:17] Tcl error [UrlTitle::handler]: error "Unterminated element 'head' (within 'script')" at position 21267
<Bot> "     csm.measure('csm_head_delivery_finished');
<Bot>     }
<Bot>   </script>
<Bot>         </head> <--Error--
<Bot>     <body id="styleguide-v2" class="fixed">
<Bot> <script>
<Bot>     if (typeof uet == 'fu"
<Bot> [20:15:17] Tcl error [UrlTitle::handler]: invalid command name ""
<Bot> [20:28:06] Tcl error [UrlTitle::handler]: error "Unterminated element 'head' (within 'script')" at position 21245
<Bot> "     csm.measure('csm_head_delivery_finished');
<Bot>     }
<Bot>   </script>
<Bot>         </head> <--Error--
<Bot>     <body id="styleguide-v2" class="fixed">
<Bot> <script>
<Bot>     if (typeof uet == 'fu"
<Bot> [20:29:22] Tcl error [UrlTitle::handler]: invalid command name ""
<Bot> [20:39:15] Tcl error [UrlTitle::handler]: error "Unterminated element 'head' (within 'script')" at position 20935
<Bot> "     csm.measure('csm_head_delivery_finished');
<Bot>     }
<Bot>   </script>
<Bot>         </head> <--Error--
<Bot>     <body id="styleguide-v2" class="fixed">
<Bot> <script>
<Bot>     if (typeof uet == 'fu"
<Bot> [20:42:18] Tcl error [UrlTitle::handler]: error "Unterminated element 'head' (within 'script')" at position 20920
<Bot> "     csm.measure('csm_head_delivery_finished');
<Bot>     }
<Bot>   </script>
<Bot>         </head> <--Error--
<Bot>     <body id="styleguide-v2" class="fixed">
<Bot> <script>
<Bot>     if (typeof uet == 'fu"
<Bot> [20:48:33] Tcl error [UrlTitle::handler]: invalid command name ""

Any idea what can cause this, and how to fix perhaps?

voidzero commented 7 years ago

Derp - forgot to replace < and > with html code entities in the above paste. Fixed this now.

voidzero commented 7 years ago

No idea where this comes from. Probably something that causes the script to be terminated preemptively?

teeli commented 7 years ago

Probably something to do with the change from regex to xpath. I tried testing it with different test cases that failed with regex earlier and didn't notice any errors. Could you give me an example URL for this?

For a quick fix, you can set tdomSupport to false on line 71

voidzero commented 7 years ago

heh well sure, blame my IRC channel for the content of those links :rofl:

The latest URL that failed was this one, and even gave some binary output:

https://pbs.twimg.com/media/C58JTUXXEAIbCUv.jpg

[20:28:12] Tcl error [UrlTitle::handler]: error "Missing ">"" at position 73173
"8 £ k¥»ìÓ@ mp.so lÚ¥dn© ×]ºÉ[Þga¼Ù 1çÚ¸l-ä qÝ  ï¢À
 <--Error-- t¢ûåv Èjwo¹ eÕ+0pEÌ´Ãi§ øî Î 'f Ú ®$ kIÛE  ?iö>Å?ã&'5"

This URL gave the following output:

https://www.amazon.com/Bro-Custom-Symbol-Tees-Doggy-Yellow/dp/B01EDXDU4M/

[20:36:34] Tcl error [UrlTitle::handler]: error "Incorrect <!... tag" at position 50987
"/01/gno/sprites/global-sprite_bluebeacon-v1._CB327533540_.png);
  }
--></style>
< <--Error-- ![endif]-->
<script type="text/javascript">var nav_t_after_preload_sprite = + n"

And this URL:

http://img.fark.net/images/cache/850/W/Wt/fark_WtjCu6v522v0PIvoDm2QVLDv97U.jpg?t=3GK9fKLvopse5AD0O7kErA&f=1488776400

[20:51:42] Tcl error [UrlTitle::handler]: error "Syntax Error" at position 94773
"à ?? y pñ  à =à à 7/ à º à $©$à ³  º¶ á à ±KÀ S` žb ?L  <b/ <--Error-- ¶s }à    ÷ &ê À?à à µ bz A à à  ©  -H8d âP£ h£ "+ yà RE|RÃ"
teeli commented 7 years ago

Thanks, that helps. I think I know what's causing this. I'll see if I can fix it over the weekend.

voidzero commented 7 years ago

Splendid. Thanks!

FevLoad commented 7 years ago

May i add the script does not fetch Twitter‘s urls example : [18:32:08] Connection to https://twitter.com/sport24_tv/status/838757876751613952 failed

knofte commented 7 years ago

@Respectme - it works for me https://twitter.com/illerg/status/838823601226690560 http://cl.motuab.com/0J2u3Q1r453r Are you sure you run latest version, and have the dependencies installed? (tcl + tls)

FevLoad commented 7 years ago

how to make sure that (tcl + tls) is installed ? Done, everything now is good, and work as it should be thank you

teeli commented 7 years ago

@voidzero I've updated a new version that at seems to work with those URLs you provided (at least in my test script). If you see any further URLs that cause errors, please report back and I'll see what's up.

voidzero commented 7 years ago

Twitter does work for me. But the first url (https://pbs.twimg.com/media/C58JTUXXEAIbCUv.jpg) still yields some problem:

[01:53:54] Tcl error [UrlTitle::handler]: error "Missing ">"" at position 73173
"8£k¥»ìÓ@mp.solÚ¥dn©×]ºÉ[Þga¼Ù1çÚ¸l-äqÝï¢À
<--Error-- t¢ûåvÈjwo¹eÕ+0pEÌ´Ãi§øîÎ'fÚ®$     kIÛE?iö>Å?ã&'5"

Didn't test the other two yet, will do that tomorrow.

teeli commented 7 years ago

That's weird. It shouldn't even try to parse image URLs anymore.

voidzero commented 7 years ago

Woops, ok, my bad. I was running eggdrop from a backup location by accident. So it was using the older urltitle.tcl. It does work fine now indeed, thanks again @teeli.

teeli commented 7 years ago

Great. Otherwise it would've been pretty mysterious :)

voidzero commented 7 years ago

Yeah that's for sure.

I have two more things, might as well put them here. First is trivial, I'd recommend replacing putserv with puthelp because as I understand it, the puthelp queue is more appropriate for this (something to do with potentially blocking IO iirc, but it's been about 1,5 decade since I learned this convention hehe)

the second is that I just wrote https://www.pastebin.com/ and got back:

Tcl error [UrlTitle::handler]: can't read "meta": variable is array
teeli commented 7 years ago

Apparently the recent changes broke redirection handling, since https://pastebin.com/ redirects to http://pastebin.com/. Should now be fixed.

NoAgendaIT commented 7 years ago

Hay!

Found another one.

Tcl error [UrlTitle::handler]: can't read "meta(Content-Type)": no such element in array

I wish my TCL-fu was to the degree where I could issue pull requests instead, but it isn't, sorry. Do you have suggestions where I can learn more about TCL?

teeli commented 7 years ago

I guess I'll have to check if that key exists in the array. Will check it later.

voidzero commented 7 years ago

Woops, NoAgendaIT is me; wrong account.

teeli commented 7 years ago

Should be fixed in the latest update.