גרסא ניסיונית חדשה v3 ל moviejukebox עם תמיכה בעברית

מחשבים, חומרה, KODI, NUC, Raspberry pi
olorin
חבר ותיק
חבר ותיק
תגובות: 2002
הצטרף: מאי 2006
נתן תודות: 236 פעמים
קיבל תודות: 98 פעמים

שליחה #21 

jpost כתב:olorin,

שיניתי מעט את הקוד שבוחר את הפוסטר. נראה שעכשיו הוא נותן עדיפות ל NFO ולקובץ תמונה.
אתה מוזמן לבדוק.

http://www.megaupload.com/?d=HNENQ4E1
...
עובד מצוין (Y)

dizingof
סמל אישי של משתמש
חבר ותיק
חבר ותיק
תגובות: 2518
הצטרף: אפריל 2005
נתן תודות: 36 פעמים
קיבל תודות: 81 פעמים

שליחה #22 

lawpower כתב:א. אחלה JPOST - מצוין!
ב. דיזינגוף - כל הכבוד!

מקווה שהעניין עם הכתוביות יסתדר במהרה (שירדו אוטומטית)
מה שרק חסר זה - שיהיה לנו ג'וקבוקס אחד - שזה סרטים שיש להורדה ב NEWS - עם פוסטרים תקצירים וטריילרים - נלחץ שם להורדה - ואז זה יתווסף לנו ישר לג'וקבוקס :)

מותר לפנטז לא?
...
http://www.hometheater.co.il/modules.ph ... 230#717230

מאד ממליץ !
לאיפה נעלם RAVE - מגיע לו תשבחות.
זאת הפעם המי יודע מה שאני משבח את השירשור שלו שלא זכה בכלל להכרה.
התוכנה והרעיון שלו מעולים !

jpost,
אנחנו ישראלים , אנחנו ידועים בכל העולם ככאלה שחושבים מחוץ לקופסא.
לישראל יש את נתח הסטראטפיסטים הגדול ביחס לאוכלוסיה.. שנמשיך? :)

מנהלי הפרוייקט לטעמי, העניקו לך חופש יצירה לייצר פלאג עברי וסקין תואם.
אין שום מניעה שתבחר רקע עם דולפינים.. ולא את הרקע השחור שבא עם הסקין defualt..
כנ"ל לגבי גודל הפונט של התקציר - אותו אתה משנה בקובץ ה CSS תחת
skins/hebrew/html/exportdetails_item_popcorn.css

בקובץ זה תוכל לשנות את הלוק כראות עינך ובעיקר את הגדלת הפונט של התקציר בעברית כי הוא אכן קטן לקריאה וכו..

באשר לקוד המוכן הקיים כבר בפרוייקט: להורדה של פוסטר ענק , חיתוכו ושמירתו כפוסטר במוביג'וקבוקס - ניתן לראות את הכלים האלו תחת :
com\moviejukebox\tools\GraphicsTools.java

אני מצרף את הקוד שלי לעיונך המתייחס לחיפוש המדוקדק באתר סב-באבה, אני אומר מדוקדק מכיוון שגיליתי שלפעמים לא תמצא פוסטר לסרט אם אתה מחפש אותו בשמו באנגלית..
ואילו אם אתה מחפש בשמו בעברית (שם הסרט שמשכת מאתר סרטים) אתה כן תקבל פוסטר.. :wink:

הקוד בודק אם קיים פוסטר גם במחלקת הפוסטרים וגם במחלקת העטיפות DVD.
אם הפוסטר שנמצא גדול ברוחב מ900 פיקסלים הקוד מבצע חיתוך לגודל של פוסטר רגיל ושומר אותו במוביג'וקבוקס.

עכשיו אין מניעה או התנגשות עם הפרוייקט - אני מבין שהפלאג אמור למסור URL של הפוסטר וזה בסדר, אבל אם הפלאג כבר הוריד את הפוסטר הראשי הפרוייקט ישתמש בו הן לפוסטר ולTHUMBNAIL.


מקווה שהצלחתי להבאיר את עצמי..
אני פה לשאלות ולסיעור מוחין :wink:







קוד: בחירת הכל

//******************************************************
// first search for a poster THEN Atifa (DVD cover)
//******************************************************


String subbabaPosterURL="";	
String finMovieUrl2="";

StringBuffer sb2 = new StringBuffer("http://search.yahoo.com/search;_ylt=A0geu5uyUa1I9hgAFCFXNyoA?p=site%3Asub-baba.com+");
			sb2.append(URLEncoder.encode(MovieTITLE, "UTF-8"));					
			String content2 = request2(new URL(sb2.toString()));
		int indexMovieLink2 =0;
		int indexMovieLink=0;
		while (indexMovieLink2  != -1){
		indexMovieLink=indexMovieLink2;
		indexMovieLink2 = content2.indexOf&#40;"<a href=".php%3fId=",indexMovieLink2+1 &#41;;
		&#125;
			

//System.out.println&#40;indexMovieLink2+"\n"&#41;;
	
			if &#40;indexMovieLink2 != -1&#41; &#123;

	finMovieUrl2=content2.substring&#40;indexMovieLink2+12, content2.indexOf&#40;"" >",indexMovieLink2&#41;&#41;;

//System.out.println&#40;finMovieUrl2+"1\n"&#41;;	

subbabaPosterURL="http&#58;//www.sub-baba.com/site/download.php?id="+finMovieUrl2+"&type=2";
content2 = request2&#40;new URL&#40;subbabaPosterURL&#41;&#41;;

indexMovieLink2 = content2.indexOf&#40;"<img src=""&#41;;
finMovieUrl2=content2.substring&#40;indexMovieLink2+10, content2.indexOf&#40;"" width=", indexMovieLink2&#41;&#41;;
subbabaPosterURL="http&#58;//www.sub-baba.com/site/"+finMovieUrl2;

// download the poster


String posterFilename = tempJukeboxRoot + File.separator + movie.getPosterFilename&#40;&#41;; 
File posterFile = new File&#40;posterFilename&#41;; 

if &#40; !posterFile.exists&#40;&#41; &#41;&#123; // if user put his own poster DONT download poster
downloadPoster2&#40;posterFile, subbabaPosterURL&#41;;
&#125;

BufferedImage bi=GraphicTools.loadJPEGImage&#40;new FileInputStream&#40;posterFile&#41;&#41;;

	if &#40;bi.getWidth&#40;&#41;>900&#41;&#123;
	BufferedImage bufImage = new BufferedImage&#40;bi.getWidth&#40;&#41;/2-35, bi.getHeight&#40;&#41;+80, BufferedImage.TYPE_INT_RGB&#41;;
           	bufImage.createGraphics&#40;&#41;.drawImage&#40;bi, 0, 0, null, null&#41;;
	
bi=GraphicTools.cropToSize&#40;bufImage.getWidth&#40;&#41;, bufImage.getHeight&#40;&#41;, bufImage&#41;;
GraphicTools.saveImageToDisk&#40; bi, posterFilename&#41;;
	&#125;

createPoster&#40;posterPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forcePosterOverwrite&#41;;
System.out.println&#40;"Hebrew Poster Found\n"&#41;;



			&#125; else &#123; // search directly FIRST with MovieTITLE     THEN with HebTitle



// search #1 for posters type=1
sb2 = new StringBuffer&#40;"http&#58;//www.sub-baba.com/site/search.php?submit=%E7%F4%F9&type=1&search="&#41;;
			sb2.append&#40;URLEncoder.encode&#40;MovieTITLE&#41;&#41;;
				
			content2 = request2&#40;new URL&#40;sb2.toString&#40;&#41;&#41;&#41;;
		indexMovieLink2 =0;
		indexMovieLink=0;
		while &#40;indexMovieLink2  != -1&#41;&#123;
		indexMovieLink=indexMovieLink2;
		indexMovieLink2 = content2.indexOf&#40;"<a href="poco.php?Id=",indexMovieLink2+1 &#41;;
		&#125;
//System.out.println&#40;indexMovieLink+"\n"&#41;;
	
			if &#40;indexMovieLink > 0&#41; &#123;

			finMovieUrl2=content2.substring&#40;indexMovieLink+21, content2.indexOf&#40;""><img src",indexMovieLink&#41;&#41;;

//System.out.println&#40;finMovieUrl2+"\n"&#41;;	

subbabaPosterURL="http&#58;//www.sub-baba.com/site/download.php?id="+finMovieUrl2+"&type=2";
content2 = request2&#40;new URL&#40;subbabaPosterURL&#41;&#41;;

indexMovieLink2 = content2.indexOf&#40;"<img src=""&#41;;
finMovieUrl2=content2.substring&#40;indexMovieLink2+10, content2.indexOf&#40;"" width=", indexMovieLink2&#41;&#41;;
subbabaPosterURL="http&#58;//www.sub-baba.com/site/"+finMovieUrl2;

// download the poster


String posterFilename = tempJukeboxRoot + File.separator + movie.getPosterFilename&#40;&#41;; 
File posterFile = new File&#40;posterFilename&#41;; 

if &#40; !posterFile.exists&#40;&#41; &#41;&#123; // if user put his own poster DONT download poster
downloadPoster2&#40;posterFile, subbabaPosterURL&#41;;
&#125;

BufferedImage bi=GraphicTools.loadJPEGImage&#40;new FileInputStream&#40;posterFile&#41;&#41;;
	if &#40;bi.getWidth&#40;&#41;>900&#41;&#123;
	BufferedImage bufImage = new BufferedImage&#40;bi.getWidth&#40;&#41;/2-35, bi.getHeight&#40;&#41;+80, BufferedImage.TYPE_INT_RGB&#41;;
           	bufImage.createGraphics&#40;&#41;.drawImage&#40;bi, 0, 0, null, null&#41;;
	
bi=GraphicTools.cropToSize&#40;bufImage.getWidth&#40;&#41;, bufImage.getHeight&#40;&#41;, bufImage&#41;;
GraphicTools.saveImageToDisk&#40; bi, posterFilename&#41;;
	&#125;

createPoster&#40;posterPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forcePosterOverwrite&#41;;
System.out.println&#40;"Hebrew Poster Found\n"&#41;;

			&#125; else &#123;  // search #2 with movieTITLE for covers "type=2"

sb2 = new StringBuffer&#40;"http&#58;//www.sub-baba.com/site/search.php?submit=%E7%F4%F9&type=2&search="&#41;;
			sb2.append&#40;URLEncoder.encode&#40;MovieTITLE&#41;&#41;;
				
			content2 = request2&#40;new URL&#40;sb2.toString&#40;&#41;&#41;&#41;;
		indexMovieLink2 =0;
		indexMovieLink=0;
		while &#40;indexMovieLink2  != -1&#41;&#123;
		indexMovieLink=indexMovieLink2;
		indexMovieLink2 = content2.indexOf&#40;"<a href="poco.php?Id=",indexMovieLink2+1 &#41;;
		&#125;
//System.out.println&#40;indexMovieLink+"\n"&#41;;
	
			if &#40;indexMovieLink > 0&#41; &#123;

			finMovieUrl2=content2.substring&#40;indexMovieLink+21, content2.indexOf&#40;""><img src",indexMovieLink&#41;&#41;;

//System.out.println&#40;finMovieUrl2+"\n"&#41;;	

subbabaPosterURL="http&#58;//www.sub-baba.com/site/download.php?id="+finMovieUrl2+"&type=2";
content2 = request2&#40;new URL&#40;subbabaPosterURL&#41;&#41;;

indexMovieLink2 = content2.indexOf&#40;"<img src=""&#41;;
finMovieUrl2=content2.substring&#40;indexMovieLink2+10, content2.indexOf&#40;"" width=", indexMovieLink2&#41;&#41;;
subbabaPosterURL="http&#58;//www.sub-baba.com/site/"+finMovieUrl2;

// download the poster


String posterFilename = tempJukeboxRoot + File.separator + movie.getPosterFilename&#40;&#41;; 
File posterFile = new File&#40;posterFilename&#41;; 

if &#40; !posterFile.exists&#40;&#41; &#41;&#123; // if user put his own poster DONT download poster
downloadPoster2&#40;posterFile, subbabaPosterURL&#41;;
&#125;

BufferedImage bi=GraphicTools.loadJPEGImage&#40;new FileInputStream&#40;posterFile&#41;&#41;;
	if &#40;bi.getWidth&#40;&#41;>900&#41;&#123;
	BufferedImage bufImage = new BufferedImage&#40;bi.getWidth&#40;&#41;/2-35, bi.getHeight&#40;&#41;+80, BufferedImage.TYPE_INT_RGB&#41;;
           	bufImage.createGraphics&#40;&#41;.drawImage&#40;bi, 0, 0, null, null&#41;;
	
bi=GraphicTools.cropToSize&#40;bufImage.getWidth&#40;&#41;, bufImage.getHeight&#40;&#41;, bufImage&#41;;
GraphicTools.saveImageToDisk&#40; bi, posterFilename&#41;;
	&#125;

createPoster&#40;posterPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forcePosterOverwrite&#41;;
System.out.println&#40;"Hebrew Poster Found\n"&#41;;

		
			&#125; else &#123;  // search direct now with HebTitle


sb2 = new StringBuffer&#40;"http&#58;//www.sub-baba.com/site/search.php?submit=%E7%F4%F9&type=0&search="&#41;;
			sb2.append&#40;URLEncoder.encode&#40;HebTitle&#41;&#41;;
				
			content2 = request2&#40;new URL&#40;sb2.toString&#40;&#41;&#41;&#41;;
	
			indexMovieLink2 = content2.indexOf&#40;"<a href="poco.php?Id="&#41;;

//System.out.println&#40;indexMovieLink2+"2\n"&#41;;
	
			if &#40;indexMovieLink2 != -1&#41; &#123;

			finMovieUrl2=content2.substring&#40;indexMovieLink2+21, content2.indexOf&#40;""><img src",indexMovieLink2&#41;&#41;;

//System.out.println&#40;finMovieUrl2+"\n"&#41;;	

subbabaPosterURL="http&#58;//www.sub-baba.com/site/download.php?id="+finMovieUrl2+"&type=2";
content2 = request2&#40;new URL&#40;subbabaPosterURL&#41;&#41;;

indexMovieLink2 = content2.indexOf&#40;"<img src=""&#41;;
finMovieUrl2=content2.substring&#40;indexMovieLink2+10, content2.indexOf&#40;"" width=", indexMovieLink2&#41;&#41;;
subbabaPosterURL="http&#58;//www.sub-baba.com/site/"+finMovieUrl2;

// download the poster


String posterFilename = tempJukeboxRoot + File.separator + movie.getPosterFilename&#40;&#41;; 
File posterFile = new File&#40;posterFilename&#41;; 

if &#40; !posterFile.exists&#40;&#41; &#41;&#123; // if user put his own poster DONT download poster
downloadPoster2&#40;posterFile, subbabaPosterURL&#41;;
&#125;

BufferedImage bi=GraphicTools.loadJPEGImage&#40;new FileInputStream&#40;posterFile&#41;&#41;;
	if &#40;bi.getWidth&#40;&#41;>900&#41;&#123;
	BufferedImage bufImage = new BufferedImage&#40;bi.getWidth&#40;&#41;/2-35, bi.getHeight&#40;&#41;+80, BufferedImage.TYPE_INT_RGB&#41;;
           	bufImage.createGraphics&#40;&#41;.drawImage&#40;bi, 0, 0, null, null&#41;;
	
bi=GraphicTools.cropToSize&#40;bufImage.getWidth&#40;&#41;, bufImage.getHeight&#40;&#41;, bufImage&#41;;
GraphicTools.saveImageToDisk&#40; bi, posterFilename&#41;;
	&#125;

createPoster&#40;posterPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forcePosterOverwrite&#41;;
System.out.println&#40;"Hebrew Poster Found\n"&#41;;


			&#125; else &#123;      // if no poster found go for DVD COVER


sb2 = new StringBuffer&#40;"http&#58;//www.sub-baba.com/site/search.php?submit=%E7%F4%F9&type=2&search="&#41;;
			sb2.append&#40;URLEncoder.encode&#40;MovieTITLE, "UTF-8"&#41;&#41;;					
			content2 = request2&#40;new URL&#40;sb2.toString&#40;&#41;&#41;&#41;;
	
			indexMovieLink2 = content2.indexOf&#40;"<a href="poco.php?Id="&#41;;
			
//System.out.println&#40;indexMovieLink2+"3\n"&#41;;
	
			if &#40;indexMovieLink2 != -1&#41; &#123;

finMovieUrl2=content2.substring&#40;indexMovieLink2+21, content2.indexOf&#40;""><img src",indexMovieLink2&#41;&#41;;

String cover = "<img src="thumbs/"+finMovieUrl2+".Cover.Heb.jpg" width=";
			
int indexCover = content2.indexOf&#40;cover,indexMovieLink2&#41;;

if &#40;indexCover == -1&#41; &#123;
indexMovieLink2 = content2.indexOf&#40;"<a href="poco.php?Id=",indexMovieLink2+1&#41;;
	if &#40;indexMovieLink2 != -1&#41; &#123;
	finMovieUrl2=content2.substring&#40;indexMovieLink2+21, content2.indexOf&#40;""><img src",indexMovieLink2&#41;&#41;;
	&#125;
&#125;


//System.out.println&#40;finMovieUrl2+"\n"&#41;;	

subbabaPosterURL="http&#58;//www.sub-baba.com/site/download.php?id="+finMovieUrl2+"&type=2";
content2 = request2&#40;new URL&#40;subbabaPosterURL&#41;&#41;;

indexMovieLink2 = content2.indexOf&#40;"<img src=""&#41;;
finMovieUrl2=content2.substring&#40;indexMovieLink2+10, content2.indexOf&#40;"" width=", indexMovieLink2&#41;&#41;;
subbabaPosterURL="http&#58;//www.sub-baba.com/site/"+finMovieUrl2;

// download the poster

String posterFilename = tempJukeboxRoot + File.separator + movie.getPosterFilename&#40;&#41;; 
File posterFile = new File&#40;posterFilename&#41;; 

if &#40; !posterFile.exists&#40;&#41; &#41;&#123;              // if user put his own poster DONT download poster
downloadPoster2&#40;posterFile, subbabaPosterURL&#41;;
&#125;


BufferedImage bi=GraphicTools.loadJPEGImage&#40;new FileInputStream&#40;posterFile&#41;&#41;;
BufferedImage bufImage = new BufferedImage&#40;bi.getWidth&#40;&#41;/2-35, bi.getHeight&#40;&#41;+80, BufferedImage.TYPE_INT_RGB&#41;;
                        bufImage.createGraphics&#40;&#41;.drawImage&#40;bi, 0, 0, null, null&#41;;

bi=GraphicTools.cropToSize&#40;bufImage.getWidth&#40;&#41;, bufImage.getHeight&#40;&#41;, bufImage&#41;;
GraphicTools.saveImageToDisk&#40; bi, posterFilename&#41;;

createPoster&#40;posterPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forcePosterOverwrite&#41;;
System.out.println&#40;"Hebrew Poster Found\n"&#41;;	
			&#125;


			&#125;&#125;&#125;&#125;



// now download hebrew thumbs from sratim.co.il

int len=address.length&#40;&#41;;

String SratimThumb= "http&#58;//www.sratim.co.il/movies/images/"+address.substring&#40;address.indexOf&#40;"?id="&#41;+4,len&#41;+".jpg";

String posterFilename = tempJukeboxRoot + File.separator + movie.getPosterFilename&#40;&#41;; 
File posterFile = new File&#40;posterFilename&#41;; 

downloadPoster2&#40;posterFile, SratimThumb&#41;;

//createPoster&#40;posterPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forcePosterOverwrite&#41;;

createThumbnail&#40;thumbnailPlugin, jukeboxDetailsRoot, tempJukeboxRoot, skinHome, movie, forceThumbnailOverwrite&#41;;

		tempJukeboxRoot = "./temp";
		tempJukeboxDetailsRoot = tempJukeboxRoot + File.separator ; 

		tempJukeboxDetailsRootFile = new File&#40;tempJukeboxDetailsRoot&#41;;
		if &#40;tempJukeboxDetailsRootFile.exists&#40;&#41;&#41; &#123;
            //Clean up
			File&#91;&#93; isoList = tempJukeboxDetailsRootFile.listFiles&#40;&#41;;
			for &#40;int nbFiles=0;nbFiles<isoList.length;nbFiles++&#41;
				isoList&#91;nbFiles&#93;.delete&#40;&#41;;
			tempJukeboxDetailsRootFile.delete&#40;&#41;;
		&#125;
		posterFile.delete&#40;&#41;;



Itay_Pollak
סמל אישי של משתמש
חבר במועדון ה-15K
חבר במועדון ה-15K
תגובות: 19136
הצטרף: אוקטובר 2005
שם מלא: איתי פולק
מיקום: הולנד
נתן תודות: 725 פעמים
קיבל תודות: 733 פעמים

שליחה #23 

הבעייה היא שאני לא יודע כמה אנשים משתמשים MYHOME...
שלא לדבר על הג'וקבוקס
הרי בתכלס - מי שרואה לבד בבית - בלי לארח - אין לו סיבה ממשית להתעסק עם כל השטויות האלה.

שלח תגובה

חזור אל “חומרה PC + סטרימרים”