51    dom = html.fromstring(resp.text)
 
   53    for item 
in eval_xpath_list(dom, results_xpath):
 
   54        relative_url = eval_xpath_getindex(item, url_xpath, 0)
 
   55        video_id = relative_url.rsplit(
'?', maxsplit=1)[0].split(
'/')[-1]
 
   57        url = f
"{base_url}/watch/{video_id}" 
   58        iframe_src = f
"{embed_url}/watch/{video_id}" 
   61        video_length = eval_xpath_getindex(item, video_length_xpath, 0)
 
   62        if len(video_length) > 0:
 
   64                timediff = datetime.strptime(video_length, 
"%M:%S")
 
   65                length = timedelta(minutes=timediff.minute, seconds=timediff.second)
 
   70        upload_time = eval_xpath_getindex(item, upload_time_xpath, 0)
 
   71        if len(upload_time) > 0:
 
   73                published_date = datetime.strptime(upload_time, 
"%Y/%m/%d %H:%M")
 
   79                'template': 
'videos.html',
 
   80                'title': extract_text(eval_xpath(item, title_xpath)),
 
   81                'content': eval_xpath_getindex(item, content_xpath, 0),
 
   83                "iframe_src": iframe_src,
 
   84                'thumbnail': eval_xpath_getindex(item, thumbnail_xpath, 0),
 
   86                "publishedDate": published_date,