PowerVu Keypatcher by taras-ua - Key updater script for AFN package channels

There are 90 replies in this Thread which was already clicked 12,212 times. The last Post () by anow2007.

  • ! UPDATED ! key_patcher v 0.92


    Code
    Changelog:
    
    v 0.92 - Added command line argument --oscam-local. Should be set when you run the script from the receiver locally.
             python3 key_patcher.py --oscam-local true
    
    v 0.91 - Fixed file not found error message.
    
    v 0.90 - Initial release candidate.


    I would like to introduce the Key updater script for AFN package channels.


    When you don’t want to wait for auto-update of keys, start watching right now.


    The script parses the keys from the forum and patches the SoftCam.Key file in your receiver via FTP. Written in Python3, only built-in modules, no additional packages need to be installed. Tested on Linux and Windows. SoftCam.Key file from the forum, but any other AFN containing EMM keys can be used. Tested on Enigma2, but should work on other Linux receivers as well. Does not affect auto-update, etc.


    Run from your computer with the command:

    > python3 key_patcher.py --ip RECEIVER_IP

    If the user or password is not root, add arguments to the startup line.


    !!! After successful completion, restart Oscam on your receiver. !!!


    An example of output:

    Code
    $ python3 key_patcher.py --ip 192.168.0.120
    2023-04-02 18:18:32,335 INFO     PowerVU KeyPatcher by taras-ua, ver 0.9
    2023-04-02 18:18:32,339 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=9999
    2023-04-02 18:18:33,319 INFO     Found last page: 19.
    2023-04-02 18:18:33,319 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=18
    2023-04-02 18:18:34,282 INFO     Got key pair ('00A9B5C3A295635C', '01A58923BD775AD9').
    2023-04-02 18:18:34,392 INFO     Found OsCam version: oscam-1.20_svn-r11718-798
    2023-04-02 18:18:34,517 INFO     /home/gx/local/oscam/SoftCam.Key has been patched with ('00A9B5C3A295635C', '01A58923BD775AD9').
    2023-04-02 18:18:34,634 INFO     Done!
  • Code
    root@vuzero4k:~# python3 /usr/script/key_patcher.py
    2023-04-03 19:37:27,812 INFO     PowerVU KeyPatcher by taras-ua, ver 0.9
    2023-04-03 19:37:27,817 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=9999
    2023-04-03 19:37:29,261 INFO     Found last page: 19.
    2023-04-03 19:37:29,262 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=18
    2023-04-03 19:37:30,829 INFO     Got key pair ('00ABAA4E11116FDE', '019369FE79AC1F83').
    2023-04-03 19:37:30,918 INFO     Found OsCam version: oscam-1.20_svn-r11718-798-ICAM-v9
    2023-04-03 19:37:31,013 INFO     /etc/tuxbox/config/SoftCam.Key has been patched with ('00ABAA4E11116FDE', '019369FE79AC1F83').
    2023-04-03 19:37:31,096 INFO     Done! Please restart OSCAM on your receiver.
  • Code
    2023-04-03 22:09:40,287 INFO     PowerVU KeyPatcher by taras-ua, ver 0.9                                                                                                                                                                         2023-04-03 22:09:40,294 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=9999                                                                                                  
    2023-04-03 22:09:41,016 INFO     Found last page: 19.                                                                                                                                                                                            2023-04-03 22:09:41,017 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=18                                                                                                    
    2023-04-03 22:09:41,722 INFO     Got key pair ('00ABAA4E11116FDE', '019369FE79AC1F83').                                                                                                                                                          Traceback (most recent call last):                                                                                                                                                                                                                 File "/usr/script/key_patcher.py", line 204, in <module>                                                                                                                                                                                           softcamkey_handler.patch_keys(key_pair)                                                                                                                                                                                                        File "/usr/script/key_patcher.py", line 172, in patch_keys                                                                                                                                                                                         oscam_config = self._download(self.oscam_version_file)                                                                                                                                                                                         File "/usr/script/key_patcher.py", line 136, in _download                                                                                                                                                                                          with FTP(self.ip, self.login, self.password) as ftp:                                                                                                                                                                                           File "/usr/lib/python3.9/ftplib.py", line 121, in __init__                                                                                                                                                                                       File "/usr/lib/python3.9/ftplib.py", line 158, in connect                                                                                                                                                                                        File "/usr/lib/python3.9/socket.py", line 844, in create_connection                                                                                                                                                                              File "/usr/lib/python3.9/socket.py", line 832, in create_connection                                                                                                                                                                            TimeoutError: [Errno 110] Connection timed out                                                                                                                                                                                                   root@osmini4k:~#                                       
  • Code
    2023-04-03 22:09:40,287 INFO     PowerVU KeyPatcher by taras-ua, ver 0.9                                                                                                                                                                         2023-04-03 22:09:40,294 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=9999                                                                                                  
    2023-04-03 22:09:41,016 INFO     Found last page: 19.                                                                                                                                                                                            2023-04-03 22:09:41,017 INFO     Connecting https://www.linuxsat-support.com/thread/152939-only-afn-powervu-keys-no-chat-keys-only/?pageNo=18                                                                                                    
    2023-04-03 22:09:41,722 INFO     Got key pair ('00ABAA4E11116FDE', '019369FE79AC1F83').                                                                                                                                                          Traceback (most recent call last):                                                                                                                                                                                                                 File "/usr/script/key_patcher.py", line 204, in <module>                                                                                                                                                                                           softcamkey_handler.patch_keys(key_pair)                                                                                                                                                                                                        File "/usr/script/key_patcher.py", line 172, in patch_keys                                                                                                                                                                                         oscam_config = self._download(self.oscam_version_file)                                                                                                                                                                                         File "/usr/script/key_patcher.py", line 136, in _download                                                                                                                                                                                          with FTP(self.ip, self.login, self.password) as ftp:                                                                                                                                                                                           File "/usr/lib/python3.9/ftplib.py", line 121, in __init__                                                                                                                                                                                       File "/usr/lib/python3.9/ftplib.py", line 158, in connect                                                                                                                                                                                        File "/usr/lib/python3.9/socket.py", line 844, in create_connection                                                                                                                                                                              File "/usr/lib/python3.9/socket.py", line 832, in create_connection                                                                                                                                                                            TimeoutError: [Errno 110] Connection timed out                                                                                                                                                                                                   root@osmini4k:~#                                       

    You should specify the IP address of your receiver in the command line and your receiver must be accessible by FTP. See example python3 key_patcher.py --ip 192.168.0.120

    And there is no need to run the script on your receiver, it could be run from your laptop as an example.

    • Official Post

    FYI, For e2 receiver's at least where i tested, there is patched versions of oscam emu and ncam that has this function built in from last year



    And for windows here:


    Also im pretty sure AU was working for AFN when i last tested - but takes 10 plus minutes to update.


    Nice script taras-ua :trophy:

  • Yes, thank you. I've tested it. It does not store the keys to SoftCam.Key immediately, you have to wait for a real EMM AU.

    Unfortunately, it has an inaccuracy with parsing two keys in one message. Also, it might be a corner case with only one key on the last page. It is a really rare situation, but it inspired me to write this script. Might you know the way to contact the author?

    • Official Post

    Monlo

    The post by esuo2 should give you a clue

    FTP the script to /usr/script/

    give the file 755 permission's

    Then issue command

    Code
    python3 /usr/script/key_patcher.py
  • I tried running it from my Android tablet via telnet,it was not successful.See results attached....


    How do I make this work?

    Check that you have copied key_patcher.py on your Android tablet. Run ls -l command in the console, It should print a list of the /home/root/ directory according to the information from your screenshot. If you have copied the script to another location just provide the correct path to the script in the command line.

  • Tried it and it didn't work


  • @ taras-ua

    on vu+uno 4k works great :) very good job :)

    Have you got script to run on receiver?

    i have oscam-emu server on raspberry and this script dont work on raspi; but i 've to run this script on raspberry pi 4

    Famavall 85 LH: 28,2 | 23,5 E | 19,2 E | 16 E | 13E | 10E | 9E | 4,8E | 0,8W

  • @ taras-ua

    on vu+uno 4k works great :) very good job :)

    Have you got script to run on receiver?

    i have oscam-emu server on raspberry and this script dont work on raspi; but i 've to run this script on raspberry pi 4

    Could you clarify "dont work on raspi;"? What is the output?

  • on raspberry i've installed Ubuntu Server and oscam server for my receiver vu+uno4kse

    ip my raspi is 192.168.8.90

    when i run you script i see this:


    # python3 afn.py --ip 192.168.8.90

    2023-04-12 17:35:32,469 INFO PowerVU KeyPatcher by taras-ua, ver 0.9

    2023-04-12 17:35:32,472 INFO Connecting ONLY AFN POWERVU KEYS - NO CHAT - KEYS ONLY !!

    2023-04-12 17:35:33,302 INFO Found last page: 23.

    2023-04-12 17:35:33,302 INFO Connecting ONLY AFN POWERVU KEYS - NO CHAT - KEYS ONLY !!

    2023-04-12 17:35:34,485 INFO Got key pair ('0016F21A4D44B182', '01B4F4DECA4EF5B0').

    Traceback (most recent call last):

    File "/home/pi/afn.py", line 204, in <module>

    softcamkey_handler.patch_keys(key_pair)

    File "/home/pi/afn.py", line 172, in patch_keys

    oscam_config = self._download(self.oscam_version_file)

    File "/home/pi/afn.py", line 136, in _download

    with FTP(self.ip, self.login, self.password) as ftp:

    File "/usr/lib/python3.10/ftplib.py", line 121, in __init__

    self.connect(host)

    File "/usr/lib/python3.10/ftplib.py", line 158, in connect

    self.sock = socket.create_connection((self.host, self.port), self.timeout,

    File "/usr/lib/python3.10/socket.py", line 845, in create_connection

    raise err

    File "/usr/lib/python3.10/socket.py", line 833, in create_connection

    sock.connect(sa)

    ConnectionRefusedError: [Errno 111] Connection refused

    Famavall 85 LH: 28,2 | 23,5 E | 19,2 E | 16 E | 13E | 10E | 9E | 4,8E | 0,8W

    Edited once, last by lukdee ().

  • Which credentials do you use for FTP on 192.168.8.90?

    Try # python3 afn.py --ip 192.168.8.90 --login YOUR_FTP_LOGIN --password YOUR_FTP_PASSWORD

  • i use python3 afn.py --ip 192.168.8.90

    port 21 is open; vsftpd is active; file oscam.version is on /tmp/.oscam/



    2023-04-12 18:31:06,420 INFO PowerVU KeyPatcher by taras-ua, ver 0.9

    2023-04-12 18:31:06,423 INFO Connecting ONLY AFN POWERVU KEYS - NO CHAT - KEYS ONLY !!

    2023-04-12 18:31:07,485 INFO Found last page: 23.

    2023-04-12 18:31:07,485 INFO Connecting ONLY AFN POWERVU KEYS - NO CHAT - KEYS ONLY !!

    2023-04-12 18:31:09,015 INFO Got key pair ('00F27C00A9CB21FD', '01B4F4DECA4EF5B0').

    2023-04-12 18:31:09,217 ERROR Could not find /tmp/.oscam/oscam.version.

    2023-04-12 18:31:09,217 ERROR OsCam config path not found on receiver.

    2023-04-12 18:31:09,217 INFO Done! Please restart OSCAM on your receiver.

    Famavall 85 LH: 28,2 | 23,5 E | 19,2 E | 16 E | 13E | 10E | 9E | 4,8E | 0,8W

  • Could you replace line #139 in the script with:


    logger.error(f'Could not find {file.as_posix()} in {l_dir}.')

    and re-run? Please save the indentation in the line.

  • @ taras-ua

    on vu+uno 4k works great :) very good job :)

    Have you got script to run on receiver?

    i have oscam-emu server on raspberry and this script dont work on raspi; but i 've to run this script on raspberry pi 4

    Have you tried e2 on rpi4?


    I mean https://images.openvision.dedy…/Vision/RPi/raspberrypi4/ or the simple cmd image without e2: https://images.openvision.dedy…ble/CMD/RPi/raspberrypi4/

  • I've solved this problem; i've copied oscam.version to the new path (where are config files) and set ftp log as root; script runs great on raspberry on ubuntu server; thanks for help :)

    Famavall 85 LH: 28,2 | 23,5 E | 19,2 E | 16 E | 13E | 10E | 9E | 4,8E | 0,8W

Softcam Keys Support Forum

Configs, Downloads, Tools, Biss Feed Keys, Regular Feed Keys, Softcam Keys, Encrypted Feeds, Feed Hunter, Biss & Powervu Encrypted Feeds.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!