import_sets
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| import_sets [2015/06/10 15:10] – admin | import_sets [2026/03/21 10:11] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Import Sets ====== | ====== Import Sets ====== | ||
| - | |||
| - | Various sponsors provide URLs in various formats: RSS (and some sponsors use nonstandard fields), XML, dump. Before update 47 you could add only standard RSS feed and It was inconvenient for automatic feeding of you site. Import Set introduced for take care of this. With Import Sets you can automatically | + | Import Sets let you automatically |
| - | How it works: Rotation - Import Sets, click "Add New". It opens the Import form with only few exceptions: input field for feed url (RSS, dump, XML), period of regrab, type of grab and delimiter. So type url to your gallery dump for example, click test, select what you want to import from this dump, select options as with regular import and click save. Script will import data from this dump every X hours. | + | To set up an import set: |
| - | ** Hints ** | + | 1. Go to Rotation > Import Sets and click "Add New" |
| + | 2. Enter the URL of your data source (dump or RSS feed) | ||
| + | 3. Set the re-grab interval (24 = every 24 hours) | ||
| + | 4. Specify the delimiter (usually " | ||
| + | 5. Click Test—the script analyzes the URL and identifies fields | ||
| + | 6. For any unidentified fields, skip them or manually select the field type | ||
| + | 7. Configure import options just like manual import | ||
| + | 8. Click Save | ||
| - | * Sometimes there' | + | Done. The import runs automatically on schedule. |
| - | * Delimiter - a division of the fields, it usually ' | + | |
| - | * Description (Strip tags) use it if RSS have something like <a href=' | + | |
| + | ===== Tips ===== | ||
| - | **Note:** there are 2 types of import sets: Add and Delete. So urls found in Add type - will be added to DB, in type = delele - will be deleted | + | - **RSS thumbnails:** Sometimes RSS feeds don't provide direct thumbnail URLs but instead contain HTML like <img src=....>. For these fields, select "Parse Thumb" instead of " |
| + | - **Delimiters: | ||
| - | ===== Import Sets Type Deletion и Hamster | ||
| - | |||
| - | This is just an example based on xhamster, but it can be used with any other data sourse. | ||
| - | Let' | + | ===== Deletion Feed ===== |
| + | |||
| + | Import Sets come in two types: **Add** (imports new galleries) and **Deletion** (removes galleries from your database). | ||
| + | |||
| + | Deletion feeds are efficient for automatic gallery removal. Instead of running [[Gallery Checker]] to test every link (which loads both your server and the sponsor's), you can subscribe to a deletion feed. Sponsors provide a list of deleted URLs, and the script checks it every X hours, automatically removing those galleries | ||
| + | |||
| + | The script supports partial URL matching. For example, if your URL is http:// | ||
| + | |||
| + | **Aggregating deletion feeds across multiple sites** | ||
| + | |||
| + | If you run multiple sites that share gallery URLs, you can aggregate deletion feeds in one location. For example: | ||
| + | |||
| + | - You have 10 deletion feed sources plus your own custom galleries | ||
| + | - These galleries are used across 100 other sites | ||
| + | - Instead of adding the 10 feeds to each of the 100 sites, add them once to a central " | ||
| + | |||
| + | On the base site, set the import type to "mark inactive" | ||
| + | |||
| + | < | ||
| + | |||
| + | <thumb num=1-100 order=date gallery_status=inactive> | ||
| + | gallery URL | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | Access the list via http:// | ||
| + | |||
| + | **Note for master-slave networks:** If you run master-slave sites sharing one database, you only need to add the deletion feed to one site—all slaves will automatically see the deletions. | ||
| + | ===== Large import sets ===== | ||
| + | |||
| + | Normally, import sets check a URL on a schedule (once per day, once every X hours) and add newly available galleries. This works well when sources add 10-20 to 1000 URLs daily. | ||
| + | |||
| + | For very large one-time imports (1 million+ URLs), add the file as an import set as usual. The script downloads and processes all URLs until the entire file is imported. Once complete, the import set automatically pauses—it won't check for daily updates since the source was a one-time bulk file. | ||
| + | |||
| + | ===== Deletion feeds with embed imports (example: xHamster) ===== | ||
| + | |||
| + | This applies to any video source, but xHamster is a common example. | ||
| + | |||
| + | **The scenario: | ||
| + | |||
| + | You set up an import set to add xHamster embeds: | ||
| http:// | http:// | ||
| - | format # | ||
| - | It it fine and works good. | + | This provides: # |
| - | But you might get into a trouble later, if a video will be deleted. | + | Everything works initially. Later, |
| + | **The solution:** | ||
| - | **What to do:** just add URL to the Import Set, for example | + | Modify the import |
| http:// | http:// | ||
| - | ie now it looks like # | ||
| + | Now it provides: # | ||
| + | |||
| + | SmartCJ stores each gallery with its source URL and can automatically match and delete videos when they appear in the deletion feed. This also applies if you use [[Gallery Checker]] instead. | ||
| + | |||
| + | **Background: | ||
| + | |||
| + | Before deletion feeds, [[Tube Import]] let you auto-import videos, but tubes delete content regularly. [[Gallery Checker]] was created to detect deletions by keyword matching (for example, searching for "Video deleted" | ||
| + | |||
| + | For both [[Gallery Checker]] and deletion imports, you need the original gallery URL. Deletion feeds are preferred over Gallery Checker when available. | ||
| + | |||
| + | **Option 2: Mismatch between import URL and deletion feed** | ||
| + | |||
| + | Sometimes the URLs in your import don't match the deletion feed. For example: | ||
| + | - You imported: http:// | ||
| + | - The tube changed URLs to: http:// | ||
| + | - The deletion feed provides only: 1234 | ||
| + | |||
| + | Store the deletion feed identifier in a custom field. For example, import as: url|custom_var1 (where custom_var1 = 1234) | ||
| + | |||
| + | Then configure the Deletion import set to match by custom_var1 instead of the main URL field. | ||
| + | |||
| + | **Important: | ||
| + | ===== Paginated import feeds ===== | ||
| + | |||
| + | Some feeds limit results to 50 items per page and require you to manually increment the page parameter. Use the {PAGE} tag to automate this. The script starts with 1 on the first run and increments by 1 each subsequent run, walking through all pages. The import stops when the URL returns no results. | ||
| + | |||
| + | If you edit the import set, the page counter resets to 1. | ||
| - | And now you can use Deletion RSS provided from xhamster, and add it as Import Set :: type = deletion. The script will automatically delete videos from this RSS. | + | ===== Custom names for import sets ===== |
| + | You can optionally assign a descriptive name to each import set. This makes it easier to identify them in the admin interface, though it's not required. | ||
import_sets.1433949003.txt.gz · Last modified: (external edit)
