Jump to content
LaunchBox Community Forums

Few questions from a new user


nny

Recommended Posts

1) Is there a way to add to a playlist from the Edit Game screen? If not, seems like a good feature to add.

2) I imported from Steam and chose "Steam Videos" but no videos actually downloaded. Any idea why?

2a) How exactly do people garner so many videos? I loved seeing on youtube the gameplay videos when you select a game in BigBox, but no game I've imported yet has had video media - they show screenshots instead.

3) Is there a way to automate adding XML entries? I have over 100 games on Twitch - right now I can do add, type in the title, click okay, and then batch download metadata/media, but I'd much prefer to just automate creating entries where the information is only the title and then batch download metadata/media for them.

I've kinda gotten it to work (Made an entry with nothing but a title, duplicated the entry with a new title and removed ID), except once I downloaded the metadata/media for the dup entry it deleted all the media from my current games. I also noticed it never filled in an ID, which I'm sure will cause issues down the line.

Link to comment
Share on other sites

Hi and welcome to the community. :)

1) Not from the edit game screen,but just a simple right click and "add to playlist" rather than going to edit.

2) Is a known issue at the moment but does not happen to everyone. So we are aware and investigating.

2a) Platform videos are available from within launchbox if you have a premium license. They are available from Tools/Download Platform/Playlist videos. Game gameplay snaps are not part of Launchbox but actually come from emumovies, and they require a paid subscription in order to be downloaded from within Launchbox.

3) You could manually edit xml files but that is not advised. You can just drag and drop the game shortcuts onto the Launchbox window and when the wizard opens choose the "none of the above" option, this just imports the .exe/shortcut without associating a emulator with it.

Hope that was of some help, any further questions fire away.

 

Link to comment
Share on other sites

2a) By Platform videos, I assume you mean videos when you select a platform (eg a NES video when hovering over NES, a PS2 video when hovering over PS2, etc)?

3) Most of the games aren't installed, so I can't make shortcuts. I like having a reference to what games I own, in case I want to install them (I leave them as broken with no application path). Sounds like I'll just have to add those games manually. Still love having an aggregate where I can view everything I own in one place over all the distribution platforms :)

Thanks a ton for the super quick response!

Link to comment
Share on other sites

5 minutes ago, nny said:

2a) By Platform videos, I assume you mean videos when you select a platform (eg a NES video when hovering over NES, a PS2 video when hovering over PS2, etc)?

3) Most of the games aren't installed, so I can't make shortcuts. I like having a reference to what games I own, in case I want to install them (I leave them as broken with no application path). Sounds like I'll just have to add those games manually. Still love having an aggregate where I can view everything I own in one place over all the distribution platforms :)

Thanks a ton for the super quick response!

2a) Yes.

3) OK, then yes im afraid that isnt a part of Launchbox. As you can probably tell by the name Launchbox is a launcher for games (or any file/program really) it isnt a database program per se. It will catalog the games you import and try to grab you information and media about those games/files, but its not a program you just type game names that you have into a file i'm afraid. 

Link to comment
Share on other sites

In terms of the steam videos, I just made a python script that will scrape and download the video from steam to the Videos folder, then add the local video file as the video path for said game. Outside of a couple request showing no video when there is one (and Steam and LaunchBox having different names for some games), it's worked well and no issues to my LaunchBox.

Would this be something I could post to share with people, or would it not be suggested since it does edit the XML?

Link to comment
Share on other sites

3 minutes ago, nny said:

In terms of the steam videos, I just made a python script that will scrape and download the video from steam to the Videos folder, then add the local video file as the video path for said game. Outside of a couple request showing no video when there is one (and Steam and LaunchBox having different names for some games), it's worked well and no issues to my LaunchBox.

Would this be something I could post to share with people, or would it not be suggested since it does edit the XML?

You are free to post anything you like to our third party downloads section. Of course this is already there though.

 

Link to comment
Share on other sites

Oh nice! Thanks for bringing that to my attention. I definitely need to check out all that's in the download section.

Mine is a bit different - it would be for a batch (eg, I ran it on ~100 games) so it's a lot better for a lot of games but his is better for once you're adding individual games. I'll clean mine up and post it there later.

  • Thanks 1
Link to comment
Share on other sites

On 4/19/2019 at 1:02 PM, nny said:

Oh nice! Thanks for bringing that to my attention. I definitely need to check out all that's in the download section.

Mine is a bit different - it would be for a batch (eg, I ran it on ~100 games) so it's a lot better for a lot of games but his is better for once you're adding individual games. I'll clean mine up and post it there later.

The scraper works for batchs as well, but only if you import it from Launchbox and/or use steam to launch game e.g. steam://rungameid/730 , but i really want to see the python code since I really like the language.

Link to comment
Share on other sites

  • 2 weeks later...

Sure! However, this was a very rough draft from before just to make sure I could do it. Also, I was new to the Steam API and couldn't figure out how to grab individual game data like yours does so I used a webscraper - after looking at your code, I would definitely change it to use the Steam API to grab the video files (would also fix an issue where the web scraper return a page without a video file, even though the game had one).

 

import requests
from bs4 import BeautifulSoup
import urllib2
import json
import time

file_type = ".webm"
base_url = "https://store.steampowered.com/app/"
not_found = []
yes_found = []
errors = []

# Open file with Steam Game Titles & ID (change to use URL)
fSteam = open("C:/LaunchBox/Data/Platforms/steam_games.json")
steam_data = json.load(fSteam)

# Open the LaunchBox file with applicable Game Titles
windows_xml = "C:/LaunchBox/Data/Platforms/Windows.xml"
launch_box_xml = open(windows_xml)
launchbox_data = BeautifulSoup(launch_box_xml, 'html.parser')
owned_games = launchbox_data.find_all('game')

for game in owned_games:
	found = False
	cur_title = game.title.text
	# If it already has a video, skip it
	if game.videopath.string != None:
		continue 
	for app_title in steam_data['applist']['apps']:
		# Found Launch Box title in Steam
		if app_title['name'] == cur_title:
			try:
				# Get Steam URL for game
				id_num = app_title['appid']
				id_str = str(id_num)
				url = base_url + id_str

				# Get data from Steam Page
				r = requests.get(url)
				soup = BeautifulSoup(r.content, 'html.parser')
				video = soup.find("div", attrs={'class': 'highlight_movie'})["data-webm-source"]

				# Download video file and write it to LaunchBox database
				rsp = urllib2.urlopen(video)
				file_name = "C:/LaunchBox/Videos/Windows/" + cur_title + file_type
				with open(file_name,'wb') as launch_box_xml:
				    launch_box_xml.write(rsp.read())
				game.videopath.string = file_name
				yes_found.append(cur_title)

				# Game found, so stop looping
				found = True
				break
			# Couldn't find video file on Steam page
			except:
				errors.append(cur_title)
				found = True
				break
	# Could not find an applicable steam game
	if (not found):
		not_found.append(cur_title)
	# Steam allows 10 calls per 10 seconds, wait 2 seconds for saftey.
	time.sleep(2)

launch_box_xml.close()

# Update Launchbox Database
f2 = open(windows_xml, "w")
f2.write(str(launchbox_data))
f2.close()

# Export Games Not Found on Steam
f3 = open("not_found.txt", "w")
f3.write(str(not_found))
f3.close()

# Export Games Found Without Videos
f4 = open("errors.txt", "w")
f4.write(str(errors))
f4.close()

# Export Games Found With Videos
f5 = open("yes_found.txt", "w")
f5.write(str(yes_found))
f5.close()

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...