def _createJsonForPosting(url, tags, dst_copy, dst_playlist, dst_rank, other_copies, repost_type, user, playlist_ordered=None, field_overrides=None, use_autotag=False): return dumps({ 'url': url, 'tags': tags, 'dst_copy': dst_copy, 'dst_playlist': dst_playlist, 'dst_rank': dst_rank, 'other_copies': other_copies, 'repost_type': repost_type, 'user': user, 'playlist_ordered': playlist_ordered, 'event_id': getEventID(), 'field_overrides': field_overrides, 'use_autotag': use_autotag })
def _postPlaylistTask(url, pid, use_autotag, user, extend=False): post_obj = { 'use_autotag': use_autotag, 'url': url, 'pid': pid, 'user': user, 'event_id': getEventID(), 'extend': extend } post_obj_json_str = dumps(post_obj) ret_obj = loads( post_raw(SCRAPER_ADDRESS + "/playlist", post_obj_json_str.encode('utf-8')).text) return ret_obj['task_id']
def refreshVideoDetailURL(url, user): log(obj={'url': url}) filterOperation('refreshVideoDetailURL', user, url) json_str = dumps({ 'url': url, 'tags': [], 'dst_copy': '', 'dst_playlist': '', 'dst_rank': -1, 'other_copies': [], 'user': user, 'playlist_ordered': None, 'update_video_detail': True, 'event_id': getEventID() }) postTask(json_str)
def refreshVideoDetail(vid, user): log(obj={'vid': vid}) filterOperation('refreshVideoDetail', user, vid) filterSingleVideo(vid, user) item = tagdb.retrive_item(vid) if item is None: raise UserError('ITEM_NOT_EXIST') json_str = dumps({ 'url': item['item']['url'], 'tags': [], 'dst_copy': '', 'dst_playlist': '', 'dst_rank': -1, 'other_copies': [], 'user': user, 'playlist_ordered': None, 'update_video_detail': True, 'event_id': getEventID() }) postTask(json_str)