Bilibili: ignore Type 8 comment
This commit is contained in:
		
							parent
							
								
									9ffbf563f0
								
							
						
					
					
						commit
						387985d709
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -174,11 +174,13 @@ def ReadCommentsBilibili(f, fontsize): | ||||||
|         try: |         try: | ||||||
|             p = str(comment.getAttribute('p')).split(',') |             p = str(comment.getAttribute('p')).split(',') | ||||||
|             assert len(p) >= 5 |             assert len(p) >= 5 | ||||||
|             assert p[1] in ('1', '4', '5', '6', '7') |             assert p[1] in ('1', '4', '5', '6', '7', '8') | ||||||
|             if p[1] != '7': |             if p[1] != '7': | ||||||
|                 c = str(comment.childNodes[0].wholeText).replace('/n', '\n') |                 c = str(comment.childNodes[0].wholeText).replace('/n', '\n') | ||||||
|                 size = int(p[2])*fontsize/25.0 |                 size = int(p[2])*fontsize/25.0 | ||||||
|                 yield (float(p[0]), int(p[4]), i, c, {'1': 0, '4': 2, '5': 1, '6': 3}[p[1]], int(p[3]), size, (c.count('\n')+1)*size, CalculateLength(c)*size) |                 yield (float(p[0]), int(p[4]), i, c, {'1': 0, '4': 2, '5': 1, '6': 3}[p[1]], int(p[3]), size, (c.count('\n')+1)*size, CalculateLength(c)*size) | ||||||
|  |             elif p[1] == '8': | ||||||
|  |                 pass  # ignore scripted comment | ||||||
|             else:  # positioned comment |             else:  # positioned comment | ||||||
|                 c = str(comment.childNodes[0].wholeText) |                 c = str(comment.childNodes[0].wholeText) | ||||||
|                 yield (float(p[0]), int(p[4]), i, c, 'bilipos', int(p[3]), int(p[2]), 0, 0) |                 yield (float(p[0]), int(p[4]), i, c, 'bilipos', int(p[3]), int(p[2]), 0, 0) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Star Brilliant
						Star Brilliant