Author Topic: Bit Che - Script Engine 3.5 - Script File Header Overview  (Read 3843 times)

Offline chip!

  • Bad Ass
  • Administrator
  • Unstoppable
  • *****
  • Posts: 2301
  • Karma: +625/-6
    • View Profile
Bit Che - Script Engine 3.5 - Script File Header Overview
« on: April 18, 2014, 10:24:52 am »
Script files should be saved as SiteName.ini and either ANSI OR UTF-16 format.


1. [script] - Required. At the top of the file:

Code: [Select]
[script]
name=SiteName.com
source=ShortSiteName
author=AuthorName
modified=author yyyy/dd/mm
version=3

Optional fields:
pwd=1 - flags the script to use the Login (site requires user/pass and login)
initialize=1 - flags the script to use the [initialize] section to process the search url and search terms before submitting a HTTP request
enabled=0 - flags the script to be disabled
notes= - just to store notes
cookie=COOKIENAME=VALUE; COOKIENAME2=VALUE; (force a cookie value or multiple cookies before searching)
referer= - force a referer URL for the search
special=1 - force using the Special Login tool (sites that require captcha, see example script in the login section below)




2. [home] - Required. These are the base URL (usually the domain) or mirrors for a Site. At least 1=URL is required.

Code: [Select]
[home]
1=http://sitename.com
2=http://sitename2.com





3. [profiles] - Required. "search type profiles" - These are the additional page strings which combined with the 'home' will create the Search URL. Put a specific string for the different profiles if the site supports it.

Code: [Select]
[profiles]
all=/search/%SEARCH%/%PAGENUM%/
audio=/search/%SEARCH%/%PAGENUM%/?categories[]=music
video=/search/%SEARCH%/%PAGENUM%/?categories[]=movies
apps=/search/%SEARCH%/%PAGENUM%/?categories[]=applications

Notes: %SEARCH% will be replaced with the Search query and %PAGENUM% (if used for multipage support) will be replaced with the current page.
Also, "all, audio, video, apps" are the default profiles, but if you are adding other profiles, such as "anime" then include a profile URL here for "anime=URL".





4. [nextpage] - Optional. If the site supports multiple page results:

Code: [Select]
[nextpage]
type=1
initial=1
morepages='INSERT EXACT HTML TO SEARCH FOR, IF FOUND THEN MEANS THERE IS ANOTHER PAGE'

Example Script: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/KickassTorrents.com.ini

Notes:

type=1 or 2
1 is for sequential order starting from the value of "initial=". For example, the first page is "1". Next it goes to "2". This is the most typical.
2 is for 'result count based', starting from value of "initial=". For example, if initial is "0", then the first page is "0". If 35 results are returned, then the next page is "35" (0 + 35). If "35" more results are returned, then page 3 is "70").

initial= the initial value for the "page" (typically this should be 1).





5. [initialize] - Optional. Used if you have initialize=1 in the [script] header.

Code: [Select]
[initialize]
code section
[/initalize]

Example Script: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/iptorrents.ini

Notes:
can manipulate pretty much anything prior to starting the search, such as: @search, @profile, @descriptions, @form (form= from [login] section), or $login (login= from [login] section), $referer, $cookie, etc





6. [login] - Optional. Used if you have pwd=1 in the [script] header. Here is an example:
Code: [Select]
[login]
referer=https://www.site.com/
prelogin=https://www.site.com/login
login=https://www.site.com/login_check
form=_username=%USER%&_password=%PASS%&_remember_me=on
failed=>Site Login</
failed2=class="error">

Optional fields:
referer= - force a referer URL for the search
login#= - can be used if a Home/Mirror requires a custom URL for login  (# matches the home #)
prelogin#= - can be used if a Home/Mirror requires a custom URL for prelogin (# matches the home #)
referer#= - can be used if a Home/Mirror requires a custom URL for referer (# matches the home #)


Example Script:
Normal Login: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/waffles.fm.ini
Special Login (for captchas, etc): https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/bt-chat.ini



7. [code0] - Optional. Used if prelogin= is set to: code(`URL`,0), then it will fetch "URL" and return to Code0 for processing BEFORE attempting to login.

Quote
[code0]
code section
[/code0]

Example Script: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/hdbits.org.ini



8. [code1] - Required. The main code section for all scripts.

Quote
[code1]
code section
[/code1]

Example Script: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/bt.etree.org.ini



9. [code2 through 9] - Optional. Used if $torrent URL is created with code() function. This allows you to fetch a 2nd,3rd,(etc) page, execute another code block and extract $torrent.

Quote
[code0]
code section
[/code0]

Example Script: https://github.com/convivea/bit-che-3-scripts/blob/master/scripts/default/rlsbb.com.ini
« Last Edit: January 25, 2015, 03:23:57 am by chip! »
  -  https://convivea.com  -   And...  boom goes the dynamite.