首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何将播放列表歌曲从android导出到windows PC

如何将播放列表歌曲从android导出到windows PC
EN

Stack Overflow用户
提问于 2016-02-12 19:17:26
回答 1查看 5.3K关注 0票数 0

所以我想把我手机上的所有歌曲都导出到我的电脑上,这是在我预装的音乐播放器中的一个特定播放列表中。这是一个应该集成的特性。但事实并非如此,而且由于音乐文件存储在许多不同的目录中,有些甚至存储在外部SD卡上,所以我不想手工操作。

谷歌没有归还任何有价值的东西,三星Kies似乎没有提供这种功能,所以我给自己写了一个批处理文件,并认为我可以分享。我在这里这样做是因为使用我的文件的人应该对他们将要做的事情有一个基本的理解,而当他们是堆栈溢出的用户时,他们可能就有了这种理解。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-12 19:17:26

对于此解决方案,需要安装亚行

如何使用我的文件:

1.使用音乐的路径创建一个文件

这个应用程序会自动这样做,并且还允许导入播放列表(没有音乐文件)。但是,您也可以通过其他方法创建该文件,例如手工创建。确保每个文件路径都位于新行上。空间没问题。

/storage/extSdCard/Instalok/Media_t4p3f3.mp3/storage/extSdCard/Instalok/Media_t6p5f3.mp3/ kilos.m4a /extSdCard/Instalok/Media_t8p7f3.mp3 kilos.m4a/storage/仿制/0/mp3/神童-3 kilos.m4a /存储/模拟/0/mp3/美人鱼。

上面的示例文件。调用该文件playlist.txt并将其存储在我的批处理文件旁边的PC上。

2.确保你的手机准备好了,

通过USB连接你的android手机和你的windows电脑,打开一个CMD。您可能需要在您的手机上启用USB调试,或者解锁锁定屏幕并允许访问。如果你的手机接通了,adb devices会把它列出来。

3.检查文件路径

如果自动生成文件,则路径可能与亚行使用的路径不同。在我的例子中,亚行使用了/mnt/sdcard,而文件包含了作为/storage/emulated/0的所有内部sdcard的路径。/storage/emulated/通过亚行存在,而dir 0则不存在。在我的例子中,它适用于外部sdcard。因此,通过使用adb shell和您常用的导航方法:cdls检查您的路径

如果您的路径与亚行需要的路径不同,请在文本文件中替换它,或者使用批处理文件中的SEARCHTEXT REPLACETEXT选项。如果你不需要我的选择,一定要用它来代替一些东西。

4.设置目标文件夹编辑批处理文件并将pathname设置为所需的目标文件夹。确保它已经存在!

5. Testrun将批处理文件存储在与playlist.txt相同的目录中,并运行它。它会要求你做一次发情。按y,然后输入,让它显示它将使用的源路径。它还将检查目标文件夹是否存在:如果不存在,则写入将变为红色。不过,它不检查源路径,这是您自己的工作。

6.再次运行,这次键入除y以外的任何内容,然后按enter键。这次它将真正运行,将指定的文件复制到目标文件夹中。

文件

保存为something.bat

代码语言:javascript
运行
复制
@echo off
REM make sure everything is set correctly
REM playlist.txt: place a text file in the same dir as this file
REM               and name it playlist.txt
REM               it should contain all file paths on the phone
REM               each path on a new line
REM                    This can be autogenerated for a playlist by https://play.google.com/store/apps/details?id=org.ssi.playlistbackup
REM pathname: Where should all the files be saved to
REM SEARCHTEXT: Where the file containing all the paths says the file is
REM REPLACETEXT: Where adb shell says the file is
REM Make sure your destination folder at pathname already exists
setlocal enabledelayedexpansion
color 0f
set pathname=F:\Files\Music
set SEARCHTEXT=/storage/emulated/0/
set REPLACETEXT=/mnt/sdcard/
set /p testrun=Is this a testrun? Testrun recommended. (y/n)
if %testrun%==y (

echo Testrun

for /F "tokens=*" %%A in (playlist.txt) do (
    set filename=%%~nxA
    set remotename=%%A
    REM replace the path with the path as adb uses it. 
    REM use "adb shell
    REM     >> ls   and >>cd
    REM " to find it out
    SET string=!remotename!
    set fixedremotepath=!string:%SEARCHTEXT%=%REPLACETEXT%!

echo I will try to load this from !fixedremotepath!  to !pathname!/!filename!
)

echo This warning always appears in Testruns: Make sure you have set all variables as specified in the comments in this file.
echo If the writing turns red, check your destination Path
echo I don't check the origin paths for correctness. If they are wrong, they will be mentioned as not found.
color 0c
cd %pathname%

) else (
for /F "tokens=*" %%A in (playlist.txt) do (
    set filename=%%~nxA
    set remotename=%%A
    REM replace the path with the path as adb uses it. 
    REM use "adb shell
    REM     >> ls   and >>cd
    REM " to find it out
    set SEARCHTEXT=/storage/emulated/0/
    set REPLACETEXT=/mnt/sdcard/
    SET string=!remotename!
    set fixedremotepath=!string:%SEARCHTEXT%=%REPLACETEXT%!

echo I WILL load this from !fixedremotepath!  to !pathname!/!filename!
REM ------------------------------------------------------------
adb pull -p "!fixedremotepath!"  "!pathname!"
REM ------------------------------------------------------------
)
)
pause
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35370535

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档