Projects STRLCPY hiphp Commits f19cf082
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    CHANGELOG
    1  -## 0.3.0 [02-01-2023][Last Version]
     1 +## 0.3.1 [06-03-2023][Last Version]
     2 + - Fix hiphp-desktop on docker and others.
     3 + - Add new menu.
     4 + - Bug fixes & performance improvements.
     5 +
     6 +## 0.3.0 [02-01-2023]
    2 7   - Bug fixes & performance improvements.
    3 8  
    4 9  ## 0.2.35 [17-12-2022]
    skipped 207 lines
  • ■ ■ ■ ■ ■ ■
    Dockerfile
    skipped 32 lines
    33 33  # docker run -e DST="True" --rm -p 127.0.0.1:8080:8080 -i -t ghcr.io/yasserbdj96/hiphp:latest
    34 34   
    35 35  #START{
    36  -FROM python:3.11.2
     36 +FROM python:3.11.1
    37 37   
    38 38  # start install google-chrome:
    39 39  # Download the Chrome Driver
    skipped 22 lines
    62 62   
    63 63  EXPOSE 8080
    64 64   
    65  -CMD ["python", "run.py"]
     65 +CMD ["python", "run.py", "docker"]
    66 66  #}END.
  • ■ ■ ■ ■
    Makefile
    skipped 36 lines
    37 37   RUN = $(PYTHON) hiphp-tk/main.py $(key) $(url)
    38 38   else
    39 39   ifeq ($(arg),dst)
    40  - RUN = $(PYTHON) hiphp-desktop/main.py
     40 + RUN = $(PYTHON) hiphp-desktop/main.py local
    41 41   else
    42 42   RUN = $(info USAGE: make run arg='cli/dst/tk' url='URL' key='KEY')
    43 43   endif
    skipped 18 lines
  • ■ ■ ■ ■
    README.md
    skipped 468 lines
    469 469   
    470 470  # run with hiphp-desktop tool:
    471 471  ❯ cd hiphp-desktop
    472  -❯ python main.py
     472 +❯ python main.py local
    473 473   
    474 474  # Run with Makefile:
    475 475  ❯ make run arg="dst"
    skipped 245 lines
  • ■ ■ ■ ■ ■ ■
    hiphp/hiphplinkextractor.py
     1 +#!/usr/bin/env python
     2 +# coding:utf-8
     3 +# | |
     4 +# --+----------------------------------------------------------+--
     5 +# | Code by : yasserbdj96 |
     6 +# | Email : [email protected] |
     7 +# | Github : https://github.com/yasserbdj96 |
     8 +# | BTC : bc1q2dks8w8uurca5xmfwv4jwl7upehyjjakr3xga9 |
     9 +# --+----------------------------------------------------------+--
     10 +# | all posts #yasserbdj96 ,all views my own. |
     11 +# --+----------------------------------------------------------+--
     12 +# | |
     13 + 
     14 +#START{
    1 15  import requests
    2 16  from urllib.parse import urlparse, urljoin
    3 17  from bs4 import BeautifulSoup
    skipped 47 lines
    51 65   return urls
    52 66   
    53 67  #print(crawl("https://asciinema.org/"))
     68 +#}END.
  • ■ ■ ■ ■
    hiphp/hiphpversion.py
    skipped 11 lines
    12 12  # | |
    13 13   
    14 14  #START{
    15  -__version__="0.2.35"
     15 +__version__="0.3.1"
    16 16  #}END.
    17 17   
  • ■ ■ ■ ■
    hiphp-linux/hiphp-desktop.sh
    skipped 10 lines
    11 11  # | |
    12 12   
    13 13  #START{
    14  -python ../hiphp-desktop/main.py
     14 +python3 ../hiphp-desktop/main.py local
    15 15  #}END.
    16 16   
  • ■ ■ ■ ■
    hiphp-win/hiphp-desktop.bat
    skipped 24 lines
    25 25   
    26 26  cd ..
    27 27  cd hiphp-desktop
    28  -!python_default_path! main.py
     28 +!python_default_path! main.py local
    29 29   
    30 30  rem }END.
    31 31   
  • install/hiphp.png
  • ■ ■ ■ ■
    install/hiphp.sh
    skipped 36 lines
    37 37   
    38 38  #hiphp_desktop:
    39 39  elif [ "$1" == "--dst" ] ; then
    40  - python3 "/usr/share/hiphp/hiphp-desktop/main.py";
     40 + python3 "/usr/share/hiphp/hiphp-desktop/main.py local";
    41 41   
    42 42  #version:
    43 43  elif [ "$1" == "--version" ] ; then
    skipped 12 lines
  • ■ ■ ■ ■ ■ ■
    menu.py
     1 +#!/usr/bin/env python
     2 +# coding:utf-8
     3 +# | |
     4 +# --+----------------------------------------------------------+--
     5 +# | Code by : yasserbdj96 |
     6 +# | Email : [email protected] |
     7 +# | Github : https://github.com/yasserbdj96 |
     8 +# | BTC : bc1q2dks8w8uurca5xmfwv4jwl7upehyjjakr3xga9 |
     9 +# --+----------------------------------------------------------+--
     10 +# | all posts #yasserbdj96 ,all views my own. |
     11 +# --+----------------------------------------------------------+--
     12 +# | |
     13 + 
     14 +#START{
     15 +import curses
     16 +import json
     17 +import subprocess
     18 + 
     19 +def main_menu(stdscr):
     20 + curses.curs_set(0)
     21 + curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)
     22 + stdscr.clear()
     23 + stdscr.refresh()
     24 + 
     25 + with open('menu_options.json', 'r') as f:
     26 + options = json.load(f)
     27 + 
     28 + option_names = list(options.keys())
     29 + selected_option = 0
     30 + 
     31 + while True:
     32 + stdscr.clear()
     33 + height, width = stdscr.getmaxyx()
     34 + 
     35 + for index, option in enumerate(option_names):
     36 + x = width//2 - len(option)//2
     37 + y = height//2 - len(option_names)//2 + index
     38 + if index == selected_option:
     39 + stdscr.attron(curses.color_pair(1))
     40 + stdscr.addstr(y, x, option)
     41 + stdscr.attroff(curses.color_pair(1))
     42 + 
     43 + stdscr.refresh()
     44 + 
     45 + key = stdscr.getch()
     46 + if key == curses.KEY_UP and selected_option > 0:
     47 + selected_option -= 1
     48 + elif key == curses.KEY_DOWN and selected_option < len(option_names) - 1:
     49 + selected_option += 1
     50 + elif key in [curses.KEY_ENTER, 10, 13]:
     51 + selected_option_name = option_names[selected_option]
     52 + selected_option_command = options[selected_option_name]
     53 + if selected_option_command == "exit()":
     54 + exit()
     55 + elif isinstance(selected_option_command, dict):
     56 + selected_option_names = list(selected_option_command.keys())
     57 + selected_option_names.remove("back") # remove the back option from the list
     58 + selected_submenu_option = 0
     59 + while True:
     60 + stdscr.clear()
     61 + height, width = stdscr.getmaxyx()
     62 + 
     63 + for index, option in enumerate(selected_option_names):
     64 + x = width//2 - len(option)//2
     65 + y = height//2 - len(selected_option_names)//2 + index
     66 + if index == selected_submenu_option:
     67 + stdscr.attron(curses.color_pair(1))
     68 + stdscr.addstr(y, x, option)
     69 + stdscr.attroff(curses.color_pair(1))
     70 + 
     71 + stdscr.refresh()
     72 + 
     73 + submenu_key = stdscr.getch()
     74 + if submenu_key == curses.KEY_UP and selected_submenu_option > 0:
     75 + selected_submenu_option -= 1
     76 + elif submenu_key == curses.KEY_DOWN and selected_submenu_option < len(selected_option_names) - 1:
     77 + selected_submenu_option += 1
     78 + elif submenu_key in [curses.KEY_ENTER, 10, 13]:
     79 + selected_submenu_name = selected_option_names[selected_submenu_option]
     80 + selected_submenu_command = selected_option_command[selected_submenu_name]
     81 + if selected_submenu_command == "back":
     82 + break # break out of the submenu loop and go back to main menu
     83 + else:
     84 + stdscr.clear()
     85 + stdscr.addstr(0, 0, f"Running: {selected_submenu_command}\n")
     86 + stdscr.refresh()
     87 + process = subprocess.Popen(selected_submenu_command, stdout=subprocess.PIPE, shell=True)
     88 + while True:
     89 + output = process.stdout.readline()
     90 + if output == b'' and process.poll() is not None:
     91 + break
     92 + if output:
     93 + stdscr.addstr(output.decode())
     94 + stdscr.refresh()
     95 + stdscr.addstr("Press any key to continue")
     96 + stdscr.refresh()
     97 + stdscr.getch()
     98 + break
     99 + selected_option = 0
     100 + 
     101 + else:
     102 + stdscr.clear()
     103 + stdscr.addstr(0, 0, f"Running: {selected_option_command}\n")
     104 + stdscr.refresh()
     105 + process = subprocess.Popen(selected_option_command, stdout=subprocess.PIPE, shell=True)
     106 + while True:
     107 + output = process.stdout.readline()
     108 + if output == b"":
     109 + break
     110 + stdscr.addstr(output.decode())
     111 + stdscr.refresh()
     112 + stdscr.addstr("Process completed. Press any key to continue.\n")
     113 + stdscr.refresh()
     114 + stdscr.getch()
     115 + 
     116 + 
     117 +curses.wrapper(main_menu)
     118 +#}END.
  • ■ ■ ■ ■ ■ ■
    menu_options.json
     1 +{
     2 + "Run":{
     3 + "Run hiphp-desktop":"python3 hiphp-desktop/main.py local",
     4 + "Run hiphp-tk":"python3 hiphp-tk/main.py",
     5 + "back": "back"
     6 + },
     7 + "Install requirements":{
     8 + "install the basic requirements":"pip install --user -r requirements.txt --break-system-packages",
     9 + "install dst requirements":"pip install --user -r hiphp-desktop/requirements-dst.txt --break-system-packages",
     10 + "install tk requirements":"pip install --user -r hiphp-tk/requirements-tk.txt --break-system-packages",
     11 + "install linux requirements":"pip install --user -r hiphp-linux/requirements-linux.txt --break-system-packages",
     12 + "install windows requirements":"pip install --user -r hiphp-win/requirements-win.txt --break-system-packages",
     13 + "install ipynb requirements":"pip install --user -r requirements-ipynb.txt --break-system-packages",
     14 + "install pypi requirements":"pip install --user -r requirements-pypi.txt --break-system-packages",
     15 + "back": "back"
     16 + },
     17 + "Install":{
     18 + "Install on debian":"cd install && bash install.sh -i",
     19 + "Install on termux":"cd install && bash install.sh -ti",
     20 + "back": "back"
     21 + },
     22 + "exit": "exit()"
     23 +}
     24 + 
  • ■ ■ ■ ■ ■
    setup.py
    skipped 45 lines
    46 46   "Programming Language :: Python :: 3.8",
    47 47   "Programming Language :: Python :: 3.9",
    48 48   "Programming Language :: Python :: 3.10",
     49 + "Programming Language :: Python :: 3.11",
    49 50   "Programming Language :: Python :: 3 :: Only",
    50 51   "Operating System :: Unix",
    51 52   "Operating System :: MacOS :: MacOS X",
    skipped 10 lines
  • ■ ■ ■ ■
    version.txt
    1  -0.3.0
     1 +0.3.1
Please wait...
Page is in error, reload to recover