kos_scrape.py - CCcam.channelinfo creator written in Python

There are 6 replies in this Thread which was already clicked 3,457 times. The last Post () by slain.

  • I've made a tool that I'd like to share with you all. People may already have such scripts, but as far as I'm aware none have been released publicly.


    Basically the tool will scrape KingOfSat.com for channel information and create a CCcam.channelinfo with up-to-date contents. It's not my intention for this to be used on-receiver, as I'm sure that KoS would not appreciate thousands of extra bot hits every day. The real aim for this is to simplify and automate the creation of CCcam.channelinfo files for sharing with others, ie. via cron on a server to share with peers, friends and your favourite communities (like linuxsat-support). :)


    Basically you generate a default config file, which has entries like the following:


    Code
    [slydigital]
    name = Sly Digital
    enabled = 1
    url = http://en.kingofsat.net/pack-slydigital.php
    cards = 0963:000000


    You can add whatever cards you like, as well as toggle individual packages on or off. Then. whenever the script is run, it will scrape the package from KoS and create a channelinfo file out of it. It can handle multiple configs and can output to any file name you choose, so you can run it multiple times in cron, with different config files and different output files.


    It adds no "spam" credits or comments into the output file, but of course you can feel free to add your own by running it through a shell script if you like.


    Anyway, give it a try and let me know what you think!


    Cheers,


    slain

  • when I start the script I get this error


    Python
    root@seccoleo-FL387AA-ABZ-a6665it:/home/seccoleo# python -i kos_scrape.py
    Traceback (most recent call last):
      File "kos_scrape.py", line 9, in <module>
        from mechanize import Browser
    ImportError: No module named mechanize
    >>>
  • You're missing a couple of Python modules. The script depends on BeautifulSoup and Mechanize. You can install them on Ubuntu by doing:


    Code
    sudo apt-get install python-beautifulsoup python-mechanize


    That should be all you need to install outside of the norm. This script was tested with Python 2.7 in an Ubuntu 12.04 environment.

  • Now everything is ok thanks
    beer10


    Excellent. Please let me know how you find the tool as it's still in active development, and I need sensible ideas for required features. As it stands though, I think it covers most peoples needs.


    Also, if you create a complete (all active CAID's added and enabled) kos_scrape.conf, please post it back to the forum for other people to use. :)

CCcam Support Forum

Configs, discussion, downloads and guides for CCcam Softcam.

Participate now!

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