mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Added the lp3.py to let elinks users listen to the lp3.
This commit is contained in:
parent
d91668b0c5
commit
2c14587b88
@ -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
11
contrib/python/lp3.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user