mirror of
https://github.com/tenox7/wrp.git
synced 2025-01-02 16:31:40 +00:00
allow to run on freebsd
This commit is contained in:
parent
40c0329d1a
commit
4526dfca64
11
README.md
11
README.md
@ -1,11 +1,14 @@
|
||||
# WRP - Web Rendering Proxy
|
||||
A HTTP proxy server that renders the web page in to a GIF/JPEG image associated with clickable imagemap of the original web links. It allows to use historical and obsolete web browsers on the modern web. It's still a work in progress but it's quite stable and usable for casual web browsing.
|
||||
A HTTP proxy server that renders the web page in to a GIF/PNG/JPEG image associated with clickable imagemap of the original web links. It allows to use historical and obsolete web browsers on the modern web. It's still a work in progress but it's quite stable and usable for casual web browsing.
|
||||
|
||||
Version 2.0 brings support for PythonMagick (ImageMagick Library) that allows to optimize and reduce image size or covert to greyscale or bitmap for these cool computers without color displays.
|
||||
|
||||
## OS Support
|
||||
WRP works on Mac OS X and Linux. It requires Python 2.7 and under Linux, PyQT4 or PyQT5.
|
||||
WRP works on macOS (Mac OS X), Linux and FreeBSD. On macOS it uses Cocoa Webkit, on Linux/FreeBSD QT Webkit, for which needs PyQT4 or PyQT5.
|
||||
|
||||
## Linux Prerequisites
|
||||
apt install python-qt5 python-pyqt5.qtwebkit
|
||||
# Installation
|
||||
* macOS - should just work
|
||||
* Linux/FreeBSD install `python-pyqt5.qtwebkit`
|
||||
|
||||
## Configuration
|
||||
Edit wrp.py, scroll past Copyright nonsense to find config parameters
|
||||
|
8
wrp.py
8
wrp.py
@ -86,7 +86,7 @@ RENDERS = {}
|
||||
### Linux CODEPATH ###
|
||||
#######################
|
||||
|
||||
if sys.platform == "linux" or sys.platform == "linux2":
|
||||
if sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
|
||||
try:
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
@ -861,7 +861,7 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
req_extension = ".jpg"
|
||||
elif FORMAT == "PNG":
|
||||
req_extension = ".png"
|
||||
elif (sys.platform == "linux" or sys.platform == "linux2") and FORMAT == "AUTO":
|
||||
elif (sys.platform.startswith('linux') or sys.platform.startswitch('freebsd')) and FORMAT == "AUTO":
|
||||
req_extension = ".jpg"
|
||||
elif sys.platform == "darwin" and FORMAT == "AUTO":
|
||||
req_extension = ".gif"
|
||||
@ -891,13 +891,13 @@ def main():
|
||||
if(FORMAT != "AUTO" and FORMAT != "GIF" and FORMAT != "JPG" and FORMAT != "PNG"):
|
||||
sys.exit("Unsupported image format \"%s\". Exiting." % FORMAT)
|
||||
|
||||
if (sys.platform == "linux" or sys.platform == "linux2") and FORMAT == "GIF" and not HasMagick:
|
||||
if (sys.platform.startswith('linux') or sys.platform.startswith('freebsd')) and FORMAT == "GIF" and not HasMagick:
|
||||
sys.exit("GIF format is not supported on this platform. Exiting.")
|
||||
|
||||
# Launch Proxy Thread
|
||||
threading.Thread(target=run_proxy).start()
|
||||
|
||||
if sys.platform == "linux" or sys.platform == "linux2":
|
||||
if sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
|
||||
import signal
|
||||
try:
|
||||
import PyQt5.QtCore
|
||||
|
Loading…
Reference in New Issue
Block a user