Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 特殊文字コードによる楽曲名の場合、意図せずソフトクラッシュする #30

Open
Asteriskx opened this issue Apr 21, 2024 · 7 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request Next-Release Next-Release

Comments

@Asteriskx
Copy link
Contributor

Asteriskx commented Apr 21, 2024

image

  • 一例 : Angeart 氏 remix 楽曲

    • 𝙎𝘼𝙔𝙊𝙉𝘼𝙍𝘼 𝙈𝘼𝙔𝘽𝙀 (Angeart Bootleg)
  • 対策案:現状なし

@Asteriskx Asteriskx added bug Something isn't working enhancement New feature or request Next-Release Next-Release labels Apr 21, 2024
@Asteriskx Asteriskx self-assigned this Apr 21, 2024
@Asteriskx
Copy link
Contributor Author

Asteriskx commented Apr 21, 2024

SoundCloud Service はまだローカルブランチにしかいないので、
リモートブランチ分のソフト影響は現状不明。
→ 但し、挙動を見る感じ Spotify 側の楽曲でも同じ現象となる気がする。

@Asteriskx
Copy link
Contributor Author

SagiriSelenium 側のソース部分かもと思って調査したけれど、検討違いかもしれない。
→ SendKeys の仕様的にも特殊コードは受け付けるとあったから。

        /// <summary>
        /// Process for uploading album art to Twitter.
        /// </summary>
        /// <param name="isCompletedPreTask"></param>
        /// <param name="tweet"></param>
        /// <returns></returns>
        private async ValueTask<bool> _UploadAlbumArtProcessAsync(Task seleniumTask, string tweet, bool isUploadPicture)
        {
            try
            {
                // Here ChromeDriver instance is not created yet :-(
                var waitInterval = (_ChromeDriver is null) ? Helper.InitialInterval : Helper.TinyInterval;
                await Task.Delay(waitInterval);

                if (!seleniumTask.IsCompletedSuccessfully)
                    return false;

                var textAreaElement = _ChromeDriver?.FindElement(By.ClassName(Helper.TweetTextAreaTag));
                textAreaElement?.Click();
                textAreaElement?.SendKeys(tweet);

@Asteriskx
Copy link
Contributor Author

現状なんもわからんになったので、GW 辺りにゆっくりデバッグする予定

@Asteriskx
Copy link
Contributor Author

Asteriskx commented May 6, 2024

  • オチ : textarea にデータ渡す部分でこけてた

image

image

@Asteriskx
Copy link
Contributor Author

@Asteriskx
Copy link
Contributor Author

ダメだったので、別途考える
https://twitter.com/Astrisk_/status/1787457643403161878

@Asteriskx
Copy link
Contributor Author

ClipBoard 活用で解決した🚀🚀🚀

        /// <summary>
        /// Process for uploading album art to Twitter.
        /// </summary>
        /// <param name="seleniumTask"></param>
        /// <param name="tweet"></param>
        /// <param name="isUploadPicture"></param>
        /// <returns></returns>
        private async ValueTask<bool> _UploadAlbumArtProcessAsync(Task seleniumTask, string tweet, bool isUploadPicture)
        {
            try
            {
                // Here ChromeDriver instance is not created yet :-(
                var waitInterval = (_ChromeDriver is null) ? Helper.InitialInterval : Helper.TinyInterval;
                await Task.Delay(waitInterval);

                if (!seleniumTask.IsCompletedSuccessfully)
                    return false;

                // [Fix] OpenQA.Selenium.WebDriverException.
                var textAreaElement = _ChromeDriver?.FindElement(By.ClassName(Helper.TweetTextAreaTag));
                textAreaElement?.Click();
                //textAreaElement?.SendKeys(tweet); 

                ClipboardHelper.SetText(tweet);
                Actions action = new(_ChromeDriver);
                action.KeyDown(Keys.Control);
                action.SendKeys("v");
                action.KeyUp(Keys.Control);
                action.Perform();

@Asteriskx Asteriskx changed the title 特殊文字コードによる楽曲名の場合、意図せずソフトクラッシュする [Bug] 特殊文字コードによる楽曲名の場合、意図せずソフトクラッシュする Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Next-Release Next-Release
Projects
None yet
Development

No branches or pull requests

1 participant