User Tools

Site Tools


import_sets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
import_sets [2015/06/10 15:07]
admin
import_sets [2020/11/30 09:55] (current)
admin [Large Import Sets]
Line 1: Line 1:
 +====== 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 galleries from virtually any source with any options including Custom Galleries, additional thumbs and so on.
 +
 +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.
 +
 +** Hints **
 +
 +  * Sometimes there's no direct URL to thumb in RSS and it looks like "some text <img src=....>". Select "Parse Thumb",  not "Thumb" in such cases.
 +  * Delimiter - a division of the fields, it usually '|' for dumps, for RSS 'item' or 'video'
 +  * Description (Strip tags) use it if RSS have something like <a href='...'> Some Description </a> while you need only Some Description.
 +
 +
 +**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 from DB.
 +
 +
 +===== Import Sets Type Deletion и Hamster  =====
 + 
 +
 +This is just an example based on xhamster, but it can be used with any other data sourse.
 +
 +Let's say you import embedded videos from xhamster, to do so you added 'Import Set' like
 +
 +  http://partners.xhamster.com/2export.php?ch=!&cnt=4&tmb=4&tcnt=10&tl=on&ord=1&url=off&em=1&ttl=on&chs=on&sz=on&dlm=|
 +  format #EMBED|#THUMB|#TITLE|#CHANNEL|#DURATION|
 +
 +It it fine and works good.
 +
 +But you might get into a trouble later, if a video will be deleted. xhamster provides a list of deleted videos as a set of urls, but when you imported videos you didn't import URL (#EMBED|#THUMB|#TITLE|#CHANNEL|#DURATION|**) 
 +
 +
 +**What to do:** just add URL to the Import Set, for example 
 +
 +  http://partners.xhamster.com/2export.php?ch=!&cnt=4&tmb=4&tcnt=10&tl=on&ord=1&url=on&em=1&ttl=on&chs=on&sz=on&dlm=|
 +  ie now it looks like  #EMBED|#THUMB|**#URL**|#TITLE|#CHANNEL|#DURATION|
 +
 +
 +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.
 +
 +
 +
 +===== Large Import Sets =====
 +
 +Note, when you add large import sets (more than 10mb) it will be imported just once, after that import set will be automatically set on pause. This way we can save server resources and do not process the same large file again.
 +
 +If you want to import smaller files you can either import using regular Rotation - Import, or pause import set manually once it has been processed.