The Pokemon company does not provide any sort of APIs to access account data or redeem codes so I had to reverse engineer all of it from the website. Otherwise, it continues to process the other two thirds. If the middle third of the video contains no codes, the algorithm abandons it and moves on to the next one. To avoid wasting time on them, I only processes one third of a video at a time. To save work, it was important not to process every video completely - some videos are long and have no codes. The pyzbar library is a fast way to do this - on a 6 core machine, a clip of 5 minutes takes around 23 seconds to process every frame. OpenCV loads the image from its saved location on ram and then processes the frames one-by-one using multiple threads. If the titles contains terms likely to yield codes (giveaway, code, etc.), it gets added to the front of the queue. Once a video is finished downloading, its name is added to a dequeue() to be processed. Is a recorded stream (definitely already redeemed)īecause download is an IO operation, I put it on a separate thread to avoid blocking search with the multiprocessing module.Length >25 minutes (staking a lot of processing power for potentially 0 codes).Has > 5 views (codes most likely already redeemed). ![]() I would skip downloading the video if it: Testing with the processing algorithm showed that 360p was clear enough to recognize QR codes which was great because it saved time on the actual video processing (less pixels) and video download (less bytes).Īssuming that it's passed through the filters, I would pass the link into pafy and download the metadata. All resolutions in between can only be streamed and not downloaded. ![]() Higher resolution videos usually also has their highest resolution available. YouTube allows mp4 downloads of all their videos at 360p. dqwords = Download Videosĭownloading the video instead of streaming it allows me to process it much faster than the maximum streaming speed (2x). The specific one I was after was the upload date filter.īecause YouTube's search is not perfect + computer vision is computationally expensive, I implemented filters on the results to skip downloading irrelevant videos/videos with low likelihood of free codes. The only changes I had to make to the package was to allow different search settings. This would conduct a youtube search for "pokemon card opening" every 3 seconds and return the links of all the results. That's why I used the youtube-search-python library. Search for new videosĮven though YouTube provides an API for searching videos, it's severely rate limited. This project was done in python and bash and it turned out to be a great choice since there were many pre-made packages that manipulated video. Mission: create a computer vision algorithm that automatically finds, downloads and scrapes YouTube videos for codes and redeem them into a player's account. If I could build an automated tool that could automatically extract and redeem the codes in the video, I could set up an alternative market for the semi-pro players to acquire codes at a much cheaper cost. There was an interesting arbitrage opportunity here. Many of them actually give away code cards during their unboxings to their viewers. Meanwhile, a number of YouTubers that regularly do unboxing videos of physical booster packs. ![]() At market prices, buying the codes would cost $0.70 * 288 = $201.60 with no guarantee of success! To complete a deck with 4 of these cards, it would take 4 x 72 = 288 packs on average. Since competitive decks often requires multiple copies of the same card (maximum 4 per deck) and decks are 60 cards, costs can easily rack up.įor example: Eternatus V is a very competitively useful card from the latest expansion with 72 possible rares. Each pack contains one guaranteed rare from the expansion's rare pool. It actually gets fairly expensive to get the cards that you need to build a competitive deck. When surveyed, most of the players in the group would buy codes directly from These would be codes resold from opened booster packs at a discount since buying booster packs outright would be too expensive. For booster packs, the contents of the virtual item are not the same as the physical ones. Code card included with physical Pokemon TCG productsĮvery physical Pokemon TCG product comes with a code card that you can use to redeem that same product online. Packs can be obtained in the PTCGO by finishing daily challenges in-game (low yield) or by buying physical Pokemon booster packs. These rares are almost exclusively found in booster packs - 10 card stratified samples of an expansion set. To play at the semi-pro level in the Pokemon online TCG (PTCGO), it is imperative to have specific rare cards in your deck. During the quarantine, I got to know a group of semi-pro Pokemon TCG online players and built a marketplace to serve their digital card needs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |