mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Fix Nature cover resolution
This commit is contained in:
		
							parent
							
								
									d17c1c6ce8
								
							
						
					
					
						commit
						d6e1365432
					
				@ -1,5 +1,5 @@
 | 
				
			|||||||
#!/usr/bin/env python
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					import re
 | 
				
			||||||
from collections import defaultdict
 | 
					from collections import defaultdict
 | 
				
			||||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
 | 
					from calibre.web.feeds.news import BasicNewsRecipe, classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -55,7 +55,7 @@ class Nature(BasicNewsRecipe):
 | 
				
			|||||||
            'img', attrs={'data-test': check_words('issue-cover-image')}
 | 
					            'img', attrs={'data-test': check_words('issue-cover-image')}
 | 
				
			||||||
        )['src']
 | 
					        )['src']
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            self.cover_url = self.cover_url.replace("w200", "w500")  # enlarge cover size resolution
 | 
					            self.cover_url = re.sub(r"\bw\d+\b", "w1000", self.cover_url)  # enlarge cover size resolution
 | 
				
			||||||
        except:
 | 
					        except:
 | 
				
			||||||
            """
 | 
					            """
 | 
				
			||||||
            failed, img src might have changed, use default width 200
 | 
					            failed, img src might have changed, use default width 200
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user