1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

Added the lp3.py to let elinks users listen to the lp3.

This commit is contained in:
Witold Filipczyk 2009-02-08 17:49:33 +01:00 committed by Witold Filipczyk
parent d91668b0c5
commit 2c14587b88
2 changed files with 15 additions and 0 deletions

View File

@ -24,6 +24,7 @@ quit_hook() -- Clean up before ELinks exits.
"""
import elinks
from lp3 import lp3
dumbprefixes = {
"7th" : "http://7thguard.net/",
@ -96,6 +97,9 @@ def pre_format_html_hook(url, html):
elif url.startswith("https://www.mbank.com.pl/ib_navibar_3.asp"):
return html.replace('<td valign="top"><img',
'<tr><td valign="top"><img')
if url.startswith("http://lp3.polskieradio.pl/"):
return lp3(html)
def proxy_for_hook(url):
"""Determine what proxy server to use for a given URL.

11
contrib/python/lp3.py Normal file
View File

@ -0,0 +1,11 @@
import re
PATTERN = re.compile('<a href="javascript:void\(null\);" onclick="play\(this,\'(http://lp3.polskieradio.pl/_files/mp3/.*mp3)\'\);">')
def zamien(m):
return '<a href="' + m.group(1) + '">'
def lp3(html):
return PATTERN.sub(zamien, html)