| 
			
			 | 
		#1 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 9 
				Karma: 10 
				Join Date: May 2014 
				
				
				
				Device: Kindle Paperwhite 2nd Generation 
				
				
				 | 
	
	
	
		
		
			
			 
			
			I am trying to remove videos from my custom news feed. I have tried everything I know about python and nothing has worked. Can someone tell me what code I need to use in order to get rid of "This video cannot be played because the JavaScript isn't enabled" 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Here is the code I made: class AdvancedUserRecipe1400969285(BasicNewsRecipe): title = u'NBC News' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True auto_cleanup_keep = '//div[@class="thumbnail"]' filterDuplicates = True remove_empty_feeds = True feeds = [ (u'Top Stories' , u'http://feeds.nbcnews.com/feeds/topstories' ) ,(u'U.S. News' , u'http://feeds.nbcnews.com/feeds/usnews' ) ,(u'Technology' , u'http://feeds.nbcnews.com/feeds/technology' ) ,(u'Investigations' , u'http://feeds.nbcnews.com/feeds/investigations' ) ,(u'Business' , u'http://feeds.nbcnews.com/feeds/business' ) ,(u'Science' , u'http://feeds.nbcnews.com/feeds/science' ) ,(u'Health' , u'http://feeds.nbcnews.com/feeds/health' ) ] remove_tags = [ dict(name='div', attrs={'class'  '^.*video.*$')}),]  
		Last edited by vinny3777; 05-25-2014 at 06:48 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			You cannot use both auto_cleanup and remove_tags. If you set auto_cleanup to true then remove tags will be ignored.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 9 
				Karma: 10 
				Join Date: May 2014 
				
				
				
				Device: Kindle Paperwhite 2nd Generation 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I tried that but then no articles came up just links and tables of contents? 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Here is the new code class AdvancedUserRecipe1400969285(BasicNewsRecipe): title = u'NBC News' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = False filterDuplicates = True remove_empty_feeds = True feeds = [ (u'Top Stories' , u'http://feeds.nbcnews.com/feeds/topstories' ) ,(u'U.S. News' , u'http://feeds.nbcnews.com/feeds/usnews' ) ,(u'Technology' , u'http://feeds.nbcnews.com/feeds/technology' ) ,(u'Investigations' , u'http://feeds.nbcnews.com/feeds/investigations' ) ,(u'Business' , u'http://feeds.nbcnews.com/feeds/business' ) ,(u'Science' , u'http://feeds.nbcnews.com/feeds/science' ) ,(u'Health' , u'http://feeds.nbcnews.com/feeds/health' ) ] remove_tags = [ dict(name='div', attrs={'class'  '^.*video.*$')}),] Please Help Kovid  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 9 
				Karma: 10 
				Join Date: May 2014 
				
				
				
				Device: Kindle Paperwhite 2nd Generation 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			PLease help anyone!!
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			If you are trying to remove tags that have the word video in their class attributes, you want 
		
	
		
		
		
		
		
		
		
		
		
		
	
	remove_tags = [ dict(name='div', attrs={'class':lambda x: x and 'video' in x.split())}), ]  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 9 
				Karma: 10 
				Join Date: May 2014 
				
				
				
				Device: Kindle Paperwhite 2nd Generation 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Did that Kovid but this is the error message that came up 
		
	
		
		
		
		
		
		
		
		
		
		
	
	calibre, version 1.37.0 ERROR: Invalid input: <p>Could not create recipe. Error:<br>invalid syntax (<string>, line 23) Here is the code again class AdvancedUserRecipe1400969285(BasicNewsRecipe): title = u'NBC News' oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = False filterDuplicates = True remove_empty_feeds = True feeds = [ (u'Top Stories' , u'http://feeds.nbcnews.com/feeds/topstories' ) ,(u'U.S. News' , u'http://feeds.nbcnews.com/feeds/usnews' ) ,(u'Technology' , u'http://feeds.nbcnews.com/feeds/technology' ) ,(u'Investigations' , u'http://feeds.nbcnews.com/feeds/investigations' ) ,(u'Business' , u'http://feeds.nbcnews.com/feeds/business' ) ,(u'Science' , u'http://feeds.nbcnews.com/feeds/science' ) ,(u'Health' , u'http://feeds.nbcnews.com/feeds/health' ) ] remove_tags = [ dict(name='div', attrs={'class':lambda x: x and 'video' in x.split())}), ]  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
| Tags | 
| calibre, news feed, video | 
| Thread Tools | Search this Thread | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Empty news feed | bubak | Recipes | 4 | 06-14-2011 08:38 PM | 
| How to create a NEWS Feed | irshwsky | Recipes | 2 | 04-18-2011 02:54 PM | 
| Two different formats on news feed | TonytheBookworm | Calibre | 3 | 10-06-2010 12:51 PM | 
| News feed scheduling | nickredding | Calibre | 1 | 01-24-2010 08:28 PM | 
| The New Yorker news feed | yekim54 | Calibre | 5 | 05-25-2009 10:33 PM |